Categories
Fab Academy AS220 - Providence, RI Fab Academy Providence -Year II - Teaching

Working MTM Snap – Almost Complete!

MTM Snap – Z and X and Y Axis Working

Jonathan Ward came down from MIT to Fab Academy AS220 @ AS220 Labs to help us with our MTM snap machine. We were missing some critical parts, so he helped us get what we had in stock to work with his design. At this point the machine is working – but we need to replace the individual stepper boards with the shield (we need the increased capacitance and we think we may have cooked the boards a bit with some initial faulty wiring.) We are also waiting for some thrust bearings to come in from McMaster Carr. They should be in shortly and I will publish an update.

Categories
Fab Academy AS220 - Providence, RI Fab Academy Providence -Year II - Teaching

Hello Serial Bus

bus

The purpose of this hello world example is to network several boards together in the form of a serial bus. The bridge board is connected to a computer via a FTDI cable. The two node boards are connected to the bridge board.

To replicate this example:

  1. Download the Fab Academy board diagrams / pngs and code.
  2. For each node in your network, you will need to modify the modify the “hello.bus.45.c” code.
  3. You need to change the line: #define node_id ‘0’ –> each node needs to have a different number (0, 1, 2, 3 – for each additional node you add.
  4. After flashing boards with 3 different node numbers:
  5. Open a Arduino IDE
  6. Open the serial monitor
  7. Enter number of note into serial monitor – press “enter”
  8. The node name (ex: node 1) should echo in on the serial monitor and the LED on the board that was flashed with the node id of 1 should flash.

Alternately- If you don’t have / want to use the Arduino IDE,

  1. After flashing boards with 3 different node numbers:
  2. Download term.py.
  3. Run term.py

In Ubuntu this is:

python term.py /dev/ttyusb0 9600

The node name (ex: node 1) should echo in on the serial monitor and the LED on the board that was flashed with the node id of 1 should flash.

Bus In Action

Categories
Fab Academy AS220 - Providence, RI Fab Academy Providence -Year II - Teaching

Fab Academy AS220 Assembles the MTM Snap

Categories
Fab Academy AS220 - Providence, RI Fab Academy Providence -Year II - Teaching

Pure Data to Arduino Over Serial

For Fab Academy, Shawn Wallace put together a basic example of getting the Arduino to make music using Pure Data.

  • Next, flash your Arduino with the following code:
void setup() {
 Serial.begin(9600);
}

void loop() {
 for (int i=0; i<255; i++) {
 Serial.write(i);
 delay(100);
 }
 for (int i=255; i>0; i--) {
 Serial.write(i);
 delay(100);
 }
}

pde

  • Then, save this Pure Data patch to a text file, name it SimpleExample.pd, and open it up in Pure Data:
#N canvas 644 73 523 614 10;
#X obj 186 309 dac~;
#X obj 110 182 r left;
#X obj 298 180 r right;
#X obj 36 150 osc~;
#X obj 80 151 osc~;
#X obj 39 194 *~ 0.2;
#X obj 235 181 *~ 0.2;
#X obj 266 227 *~ 1;
#X obj 90 226 *~ 1;
#X obj 35 47 comport 9600;
#X msg 36 17 devices;
#X msg 95 19 open 2;
#X floatatom 35 70 5 0 0 0 - - -;
#X obj 35 102 * 10;
#X obj 75 103 * 20;
#X connect 1 0 8 1;
#X connect 2 0 7 1;
#X connect 3 0 5 0;
#X connect 4 0 6 0;
#X connect 5 0 8 0;
#X connect 6 0 7 0;
#X connect 7 0 0 1;
#X connect 8 0 0 0;
#X connect 9 0 12 0;
#X connect 10 0 9 0;
#X connect 11 0 9 0;
#X connect 12 0 13 0;
#X connect 12 0 14 0;
#X connect 13 0 3 0;
#X connect 14 0 4 0;

A nice feature of Pd is that all the patches are in a simple text format.

To Get this Example Working:

  • Open Pure Data
  • Open the “SimpleExample.pd” file in Pure Data
  • Click on the “devices” message box: This will list any available serial ports in a numbered list.
  • On my Mac, the usb port connected to the microcontroller was on port 2; (it may be different on your computer)
  • Find the correct port number and change the “open” message from “open 2” to “open (your port # here)”. To do that, enter Edit mode under the Edit menu. Now you can type directly into the message boxes. After you change the “open” message, leave edit mode and do the following:
  • 1. Select “compute audio” in the main Pd window
  • 2. Click on the “open” message to open the serial connection

pd

You should see output of the comport changing, and should hear a rising and falling tone.