diff options
-rw-r--r-- | Pd_firmware/Pd_firmware.pde | 200 | ||||
-rw-r--r-- | arduino-help.pd | 206 | ||||
-rw-r--r-- | arduino.pd | 330 |
3 files changed, 388 insertions, 348 deletions
diff --git a/Pd_firmware/Pd_firmware.pde b/Pd_firmware/Pd_firmware.pde index 6e18df8..098d878 100644 --- a/Pd_firmware/Pd_firmware.pde +++ b/Pd_firmware/Pd_firmware.pde @@ -14,7 +14,8 @@ /*
* Pduino protocol
* ===============
- * data: 0-127 control: 128-255
+ * data: 0-127
+ * control: 128-255
*
* Pd->Arduino commands
* --------------------
@@ -23,13 +24,12 @@ * 230 - next byte sets PWM0 value
* 231 - next byte sets PWM1 value
* 232 - next byte sets PWM2 value
- *
*
* Pd->Arduino byte cycle
* ----------------------
- * 0 cycle marker (255/11111111)
- * 1 digitalOut 0-6 bitmask
- * 2 digitalOut 7-13 bitmask
+ * 0 digitalOut 0-6 bitmask
+ * 1 digitalOut 7-13 bitmask
+ * 2 cycle marker (255/11111111)
*
* Arduino->Pd byte cycle
* ----------------------
@@ -63,49 +63,74 @@ #define TOTAL_DIGITAL_PINS 14
-byte i;
+// for comparing along with INPUT and OUTPUT
+#define PWM 2
+
+// this flag says the next serial input will be data, not control
+boolean waitForData = false;
-// this flag says that the next serial input will be data, not control
-boolean waitForData = 0;
+// this flag says the first data byte for the digital outs is next
+boolean firstInputByte = false;
/* this int serves as an array of bits to store pin status
* 0 = INPUT, 1 = OUTPUT
*/
int digitalPinStatus;
+/* this byte stores the status off whether PWM is on or not
+ * bit 9 = PWM0, bit 10 = PWM1, bit 11 = PWM2
+ * the rest of the bits are unused and should remain 0
+ */
+int pwmStatus;
+
byte analogPin;
int analogData;
// -------------------------------------------------------------------------
-void outputDigital(byte startPin) {
+void transmitDigitalInput(byte startPin) {
+ byte i;
byte digitalPin;
byte digitalPinBit;
- byte digitalOutputByte;
+ byte transmitByte;
byte digitalData;
- for(i=0;i<7;++i)
- {
+
+ for(i=0;i<7;++i) {
digitalPin = i+startPin;
digitalPinBit = OUTPUT << digitalPin;
// only read the pin if its set to input
if(digitalPinStatus & digitalPinBit) {
digitalData = 0; // pin set to OUTPUT, don't read
}
+ else if( (digitalPin >= 9) && (pwmStatus & (1 << digitalPin)) ) {
+ digitalData = 0; // pin set to PWM, don't read
+ }
else {
- digitalData = digitalRead(digitalPin);
+ // digitalData = digitalRead(digitalPin);
+ digitalData = pwmStatus;
}
- digitalOutputByte = digitalOutputByte + (2^(i+1-startPin)*digitalData);
+ transmitByte = transmitByte + (2^(i+1-startPin)*digitalData);
}
- printByte(digitalOutputByte);
+ printByte(transmitByte);
}
// -------------------------------------------------------------------------
+/* this function sets the pin mode to the correct state and sets the relevant
+ * bits in the two bit-arrays that track Digital I/O and PWM status
+ */
void setPinMode(int pin, int mode) {
- pinMode(pin,mode);
if(mode == INPUT) {
- digitalPinStatus = digitalPinStatus &~ (1 << pin);
+ digitalPinStatus = digitalPinStatus &~ (1 << pin);
+ pwmStatus = pwmStatus &~ (1 << pin);
+ pinMode(pin,INPUT);
}
- if(mode == OUTPUT) {
- digitalPinStatus = digitalPinStatus | (1 << pin);
+ else if(mode == OUTPUT) {
+ digitalPinStatus = digitalPinStatus | (1 << pin);
+ pwmStatus = pwmStatus &~ (1 << pin);
+ pinMode(pin,OUTPUT);
+ }
+ else if( (mode == PWM) && (pin >= 9) && (pin <= 11) ) {
+ digitalPinStatus = digitalPinStatus &~ (1 << pin);
+ pwmStatus = pwmStatus | (1 << pin);
}
}
@@ -120,65 +145,64 @@ void checkForInput() { // -------------------------------------------------------------------------
void processInput(int inputData) {
+ // the PWM commands (230-232) have a byte of data following the command
if (waitForData > 0) {
- // the PWM commands (230-232) have a byte of data following the command
+ printByte(150);
+ printByte(inputData);
analogWrite(waitForData,inputData);
waitForData = 0;
}
+ else if(inputData < 128) {
+ printByte(151);
+ printByte(inputData);
+// TODO: this section is for digital out...
+ }
else {
+ printByte(153);
switch (inputData) {
- case 200:
- case 201:
- case 202:
- case 203:
- case 204:
- case 205:
- case 206:
- case 207:
- case 208:
- case 209:
- case 210:
- case 211:
- case 212:
- case 213:
- setPinMode(inputData-200,OUTPUT);
- printByte(inputData);
- printByte(inputData);
- printByte(inputData);
- printByte(inputData);
- break;
- case 214:
- case 215:
- case 216:
- case 217:
- case 218:
- case 219:
- case 220:
- case 221:
- case 222:
- case 223:
- case 224:
- case 225:
- case 226:
- case 227:
- setPinMode(inputData-214,INPUT);
- printByte(inputData);
- printByte(inputData);
- printByte(inputData);
- printByte(inputData);
- break;
- case 230:
- case 231:
- case 232:
- // set waitForData to the PWM pin number
- waitForData = inputData - 221;
- printByte(inputData);
- printByte(inputData);
- printByte(inputData);
- printByte(inputData);
- break;
- case 255:
- break;
+ case 200:
+ case 201:
+ case 202:
+ case 203:
+ case 204:
+ case 205:
+ case 206:
+ case 207:
+ case 208:
+ case 209:
+ case 210:
+ case 211:
+ case 212:
+ case 213:
+ printByte(inputData);
+ setPinMode(inputData-200,OUTPUT);
+ break;
+ case 214:
+ case 215:
+ case 216:
+ case 217:
+ case 218:
+ case 219:
+ case 220:
+ case 221:
+ case 222:
+ case 223:
+ case 224:
+ case 225:
+ case 226:
+ case 227:
+ printByte(inputData);
+ setPinMode(inputData-214,INPUT);
+ break;
+ case 230:
+ case 231:
+ case 232:
+ printByte(inputData);
+ waitForData = inputData - 221; // set waitForData to the PWM pin number
+ setPinMode(waitForData, PWM);
+ break;
+ case 255:
+ break;
}
}
}
@@ -187,31 +211,33 @@ void processInput(int inputData) { // -------------------------------------------------------------------------
void setup() {
+ byte i;
+
beginSerial(9600);
for(i=0; i<TOTAL_DIGITAL_PINS; ++i) {
- setPinMode(i,INPUT);
+ setPinMode(i,INPUT);
}
}
// -------------------------------------------------------------------------
void loop() {
// read all digital pins
- outputDigital(0);
- outputDigital(7);
+ transmitDigitalInput(0);
+ transmitDigitalInput(7);
/*
* get analog in
*/
-/*
- for(analogPin=0; analogPin<5; ++analogPin)
- {
- analogData = analogRead(analogPin);
- // these two bytes get converted back into the whole number in Pd
- printByte(analogData >> 7); // bitshift the big stuff into the output byte
- printByte(analogData % 128); // mod by 32 for the small byte
- }
-*/
-// ++analogPin;
-// if (analogPin > 5) analogPin = 0;
+ /*
+ for(analogPin=0; analogPin<5; ++analogPin)
+ {
+ analogData = analogRead(analogPin);
+ // these two bytes get converted back into the whole number in Pd
+ printByte(analogData >> 7); // bitshift the big stuff into the output byte
+ printByte(analogData % 128); // mod by 32 for the small byte
+ }
+ */
+ // ++analogPin;
+ // if (analogPin > 5) analogPin = 0;
/* end with the cycle marker */
// bitshift the big stuff into the output byte
printByte(digitalPinStatus >> 7);
@@ -219,6 +245,6 @@ void loop() { printByte(digitalPinStatus % 128);
checkForInput();
-
+
printByte(255);
}
diff --git a/arduino-help.pd b/arduino-help.pd new file mode 100644 index 0000000..ab232db --- /dev/null +++ b/arduino-help.pd @@ -0,0 +1,206 @@ +#N canvas 245 4 630 669 10;
+#X obj 478 -14 import cyclone zexy;
+#X obj 9 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0 14
+-3754 -1 -1 0 256;
+#X obj 110 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+14 -3754 -1 -1 0 256;
+#X text 295 251 On Mac OS X \, set this to the right value:;
+#X msg 179 213 open \$1;
+#N canvas 162 133 530 380 serin 0;
+#X obj 120 61 cnv 15 15 15 empty \$0-number-canvas 2 4 7 0 14 -233017
+-1 0;
+#X obj 200 225 s \$0-number-canvas;
+#X obj 60 61 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -225271 -1
+-1 2;
+#X obj 59 147 outlet;
+#X obj 60 13 inlet;
+#X msg 200 202 label \$1;
+#X obj 200 180 makefilename %d;
+#X obj 59 108 float;
+#X connect 2 0 7 0;
+#X connect 4 0 2 0;
+#X connect 5 0 1 0;
+#X connect 6 0 5 0;
+#X connect 7 0 3 0;
+#X connect 7 0 6 0;
+#X coords 0 -1 1 1 76 17 1 60 60;
+#X restore 179 190 pd serin;
+#X text 260 191 serial port #;
+#X text 278 620 released under the GNU GPL;
+#X text 64 605 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
+;
+#X obj 211 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+14 -3754 -1 -1 0 256;
+#X obj 312 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+14 -3754 -1 -1 0 256;
+#X obj 413 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+14 -3754 -1 -1 0 256;
+#X obj 383 358 spigot;
+#X obj 412 339 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#X msg 239 213 close;
+#X obj 64 570 print --------------------;
+#X obj 466 515 receive \$0-A;
+#X obj 9 5 receive \$0-B;
+#X obj 110 5 receive \$0-C;
+#X obj 211 5 receive \$0-D;
+#X obj 312 5 receive \$0-E;
+#X obj 413 5 receive \$0-F;
+#X msg 299 269 devicename /dev/tty.usbserial-1913;
+#X obj 230 357 spigot;
+#X obj 261 339 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
+1;
+#X obj 227 382 select 255;
+#X obj 510 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+14 -3754 -1 -1 0 256;
+#X obj 510 5 receive \$0-G;
+#X obj 395 83 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -262144 -1
+-1 0;
+#X obj 372 84 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X obj 391 156 +;
+#X obj 372 130 * 14;
+#X obj 391 177 + 200;
+#X floatatom 477 130 5 0 0 0 - - -;
+#X obj 395 102 t b f;
+#X obj 249 414 tolist;
+#X obj 252 522 print;
+#X obj 252 503 list;
+#X obj 276 436 list-len;
+#X obj 276 456 change;
+#X obj 126 374 spigot;
+#X obj 159 356 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#X obj 152 427 print;
+#X obj 278 477 bang;
+#N canvas 295 269 590 311 decode 0;
+#X obj 241 26 inlet;
+#X obj 46 189 & 1;
+#X obj 72 189 & 2;
+#X obj 98 189 & 4;
+#X obj 46 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X obj 72 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 2
+;
+#X obj 98 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 4
+;
+#X obj 124 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+8;
+#X obj 150 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+16;
+#X obj 182 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+32;
+#X obj 215 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+64;
+#X obj 248 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+128;
+#X obj 287 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+256;
+#X obj 326 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+512;
+#X obj 365 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1024;
+#X obj 409 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+2048;
+#X obj 453 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+2;
+#X obj 499 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+4;
+#X obj 124 189 & 8;
+#X obj 150 189 & 16;
+#X obj 182 189 & 32;
+#X obj 215 189 & 64;
+#X obj 248 189 & 128;
+#X obj 287 189 & 256;
+#X obj 326 189 & 512;
+#X obj 365 189 & 1024;
+#X obj 409 189 & 2048;
+#X obj 453 189 & 4096;
+#X obj 499 189 & 8192;
+#X connect 0 0 1 0;
+#X connect 0 0 2 0;
+#X connect 0 0 3 0;
+#X connect 0 0 18 0;
+#X connect 0 0 19 0;
+#X connect 0 0 20 0;
+#X connect 0 0 21 0;
+#X connect 0 0 22 0;
+#X connect 0 0 23 0;
+#X connect 0 0 24 0;
+#X connect 0 0 25 0;
+#X connect 0 0 26 0;
+#X connect 0 0 27 0;
+#X connect 0 0 28 0;
+#X connect 1 0 4 0;
+#X connect 2 0 5 0;
+#X connect 3 0 6 0;
+#X connect 18 0 7 0;
+#X connect 19 0 8 0;
+#X connect 20 0 9 0;
+#X connect 21 0 10 0;
+#X connect 22 0 11 0;
+#X connect 23 0 12 0;
+#X connect 24 0 13 0;
+#X connect 25 0 14 0;
+#X connect 26 0 15 0;
+#X connect 27 0 16 0;
+#X connect 28 0 17 0;
+#X restore 466 541 pd decode buttons;
+#X obj 57 55 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 1900 1;
+#X msg 78 531 bang;
+#X msg 21 221 255 \, 127 \, 127;
+#X obj 235 297 arduino 3;
+#X obj 123 399 select 255;
+#X floatatom 434 104 5 0 0 0 - - -;
+#X text 504 66 7;
+#X text 399 66 0;
+#X text 546 67 10;
+#X msg 54 118 \$2 \, \$1;
+#X obj 54 93 pack float float;
+#X msg 94 72 230;
+#X msg 123 72 231;
+#X msg 155 72 232;
+#X connect 4 0 48 0;
+#X connect 5 0 4 0;
+#X connect 13 0 12 1;
+#X connect 14 0 48 0;
+#X connect 16 0 44 0;
+#X connect 17 0 1 0;
+#X connect 18 0 2 0;
+#X connect 22 0 48 0;
+#X connect 23 0 25 0;
+#X connect 24 0 23 1;
+#X connect 25 0 35 1;
+#X connect 25 1 35 0;
+#X connect 27 0 26 0;
+#X connect 28 0 34 0;
+#X connect 28 0 50 0;
+#X connect 29 0 31 0;
+#X connect 30 0 32 0;
+#X connect 31 0 30 0;
+#X connect 32 0 33 0;
+#X connect 32 0 48 0;
+#X connect 34 0 31 0;
+#X connect 34 1 30 1;
+#X connect 35 0 37 1;
+#X connect 35 0 38 0;
+#X connect 37 0 36 0;
+#X connect 38 0 39 0;
+#X connect 39 0 43 0;
+#X connect 40 0 49 0;
+#X connect 41 0 40 1;
+#X connect 43 0 37 0;
+#X connect 45 0 55 0;
+#X connect 46 0 15 0;
+#X connect 47 0 48 0;
+#X connect 48 0 12 0;
+#X connect 48 0 23 0;
+#X connect 48 0 40 0;
+#X connect 49 0 15 0;
+#X connect 49 1 42 0;
+#X connect 54 0 48 0;
+#X connect 55 0 54 0;
+#X connect 56 0 55 1;
+#X connect 57 0 55 1;
+#X connect 58 0 55 1;
@@ -1,47 +1,8 @@ -#N canvas 375 1 618 657 10;
-#X obj 478 -14 import cyclone zexy;
-#X obj 9 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0 14
--3754 -1 -1 8191 256;
-#X obj 110 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-14 -3754 -1 -1 27606 256;
-#X text 239 179 On Mac OS X \, set this to the right value:;
-#X msg 179 158 open \$1;
-#X text 12 101 You might need to select another port \, check the Pd
-window to see if it connected successfully:;
-#N canvas 162 133 530 380 serin 0;
-#X obj 120 61 cnv 15 15 15 empty \$0-number-canvas 2 4 7 0 14 -233017
--1 0;
-#X obj 200 225 s \$0-number-canvas;
-#X obj 60 61 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -225271 -1
--1 2;
-#X obj 59 147 outlet;
-#X obj 60 13 inlet;
-#X msg 200 202 label \$1;
-#X obj 200 180 makefilename %d;
-#X obj 59 108 float;
-#X connect 2 0 7 0;
-#X connect 4 0 2 0;
-#X connect 5 0 1 0;
-#X connect 6 0 5 0;
-#X connect 7 0 3 0;
-#X connect 7 0 6 0;
-#X coords 0 -1 1 1 76 17 1 60 60;
-#X restore 179 135 pd serin;
-#X text 260 136 serial port #;
-#X text 278 620 released under the GNU GPL;
-#X text 64 605 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
+#N canvas 81 0 548 475 10;
+#X obj 388 -14 import cyclone zexy;
+#X text 331 417 released under the GNU GPL;
+#X text 117 402 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
;
-#X obj 211 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-14 -3754 -1 -1 0 256;
-#X obj 312 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-14 -3754 -1 -1 0 256;
-#X obj 413 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-14 -3754 -1 -1 0 256;
-#X obj 179 246 spigot;
-#X obj 229 248 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-1;
-#X msg 239 158 close;
-#X obj 64 570 print --------------------;
#N canvas 630 546 462 312 alternate 0;
#X obj 87 8 inlet;
#X obj 151 244 outlet;
@@ -87,226 +48,73 @@ window to see if it connected successfully:; #X connect 16 0 17 0;
#X connect 17 0 14 1;
#X connect 18 0 13 1;
-#X restore 258 345 pd alternate;
-#X msg 179 299 reset;
-#X obj 297 304 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 321 386 +;
-#X obj 321 407 trigger bang float;
-#X obj 329 539 pack symbol float;
-#X obj 311 517 makefilename \$0-%c;
-#X msg 330 562 \; \$1 \$2;
-#X obj 18 57 receive \$0-A;
-#X obj 9 5 receive \$0-B;
-#X obj 110 5 receive \$0-C;
-#X obj 211 5 receive \$0-D;
-#X obj 312 5 receive \$0-E;
-#X obj 413 5 receive \$0-F;
-#X obj 311 463 +;
-#X obj 339 463 float;
-#X msg 340 442 0;
-#X msg 311 442 1;
-#X obj 311 493 + 64;
-#X obj 3 525 spigot;
-#X obj 41 497 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
-;
-#X obj 439 335 gate 4;
-#X obj 430 359 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+#X restore 144 130 pd alternate;
+#X msg 89 99 reset;
+#X obj 207 171 +;
+#X obj 207 192 trigger bang float;
+#X obj 215 324 pack symbol float;
+#X obj 197 248 +;
+#X obj 225 248 float;
+#X msg 226 227 0;
+#X msg 197 227 1;
+#X obj 197 278 + 64;
+#X obj 349 135 gate 4;
+#X obj 340 159 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
-#X obj 448 359 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+#X obj 358 159 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
-#X obj 467 359 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+#X obj 377 159 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
-#X obj 486 359 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+#X obj 396 159 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
-#X obj 477 314 metro 400;
-#X obj 478 294 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-1;
-#X obj 406 261 float;
-#X obj 449 261 + 1;
-#X obj 406 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 492 259 bang;
-#X msg 425 227 1;
-#X obj 406 283 moses 5;
-#X obj 179 273 select 255;
-#X msg 243 197 devicename /dev/tty.usbserial-1913;
-#X obj 124 373 spigot;
-#X obj 162 345 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
-1;
-#X obj 121 398 select 255;
-#X obj 510 25 nbx 6 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-14 -3754 -1 -1 0 256;
-#X obj 510 5 receive \$0-G;
-#X obj 179 225 comport 0 9600;
-#X obj 398 53 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -262144 -1
--1 0;
-#X obj 375 54 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
-;
-#X obj 394 126 +;
-#X obj 375 100 * 14;
-#X obj 394 147 + 200;
-#X floatatom 480 100 5 0 0 0 - - -;
-#X obj 398 72 t b f;
-#X obj 143 430 tolist;
-#X obj 146 538 print;
-#X obj 146 519 list;
-#X obj 170 452 list-len;
-#X obj 170 472 change;
-#X obj 40 369 spigot;
-#X obj 78 341 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+#X obj 387 114 metro 400;
+#X obj 388 94 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
-#X obj 37 394 select 255;
-#X obj 66 422 print;
-#X obj 172 493 bang;
-#X obj 337 365 * 128;
-#N canvas 295 269 586 307 decode 1;
-#X obj 241 26 inlet;
-#X obj 46 189 & 1;
-#X obj 72 189 & 2;
-#X obj 98 189 & 4;
-#X obj 46 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
-;
-#X obj 72 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 2
-;
-#X obj 98 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 4
-;
-#X obj 124 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 8
-8;
-#X obj 150 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-16;
-#X obj 182 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-32;
-#X obj 215 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-64;
-#X obj 248 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 128
-128;
-#X obj 287 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-256;
-#X obj 326 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-512;
-#X obj 365 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1024
-1024;
-#X obj 409 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-2048;
-#X obj 453 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-2;
-#X obj 499 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-4;
-#X obj 124 189 & 8;
-#X obj 150 189 & 16;
-#X obj 182 189 & 32;
-#X obj 215 189 & 64;
-#X obj 248 189 & 128;
-#X obj 287 189 & 256;
-#X obj 326 189 & 512;
-#X obj 365 189 & 1024;
-#X obj 409 189 & 2048;
-#X obj 453 189 & 4096;
-#X obj 499 189 & 8192;
-#X connect 0 0 1 0;
-#X connect 0 0 2 0;
-#X connect 0 0 3 0;
-#X connect 0 0 18 0;
-#X connect 0 0 19 0;
-#X connect 0 0 20 0;
-#X connect 0 0 21 0;
-#X connect 0 0 22 0;
-#X connect 0 0 23 0;
-#X connect 0 0 24 0;
-#X connect 0 0 25 0;
-#X connect 0 0 26 0;
-#X connect 0 0 27 0;
-#X connect 0 0 28 0;
-#X connect 1 0 4 0;
-#X connect 2 0 5 0;
-#X connect 3 0 6 0;
-#X connect 18 0 7 0;
-#X connect 19 0 8 0;
-#X connect 20 0 9 0;
-#X connect 21 0 10 0;
-#X connect 22 0 11 0;
-#X connect 23 0 12 0;
-#X connect 24 0 13 0;
-#X connect 25 0 14 0;
-#X connect 26 0 15 0;
-#X connect 27 0 16 0;
-#X connect 28 0 17 0;
-#X restore 34 133 pd decode buttons;
-#X msg 66 164 230 \, 128;
-#X msg 66 191 231 \, 64;
-#X msg 67 213 232 \, 32;
-#X connect 4 0 58 0;
-#X connect 6 0 4 0;
-#X connect 13 0 51 0;
-#X connect 14 0 13 1;
-#X connect 15 0 58 0;
-#X connect 17 0 20 0;
-#X connect 17 1 76 0;
-#X connect 18 0 17 0;
-#X connect 18 0 33 0;
-#X connect 19 0 17 0;
-#X connect 20 0 21 0;
-#X connect 21 0 34 0;
-#X connect 21 1 22 1;
-#X connect 22 0 24 0;
-#X connect 23 0 22 0;
-#X connect 25 0 36 0;
-#X connect 25 0 77 0;
-#X connect 26 0 1 0;
-#X connect 27 0 2 0;
-#X connect 31 0 32 0;
-#X connect 31 0 35 0;
-#X connect 32 0 31 1;
-#X connect 33 0 32 0;
-#X connect 34 0 31 0;
-#X connect 35 0 23 0;
-#X connect 36 0 16 0;
-#X connect 37 0 36 1;
-#X connect 38 0 39 0;
-#X connect 38 1 40 0;
-#X connect 38 2 41 0;
-#X connect 38 3 42 0;
-#X connect 43 0 38 1;
-#X connect 44 0 43 0;
-#X connect 45 0 50 0;
-#X connect 46 0 45 1;
-#X connect 47 0 45 0;
-#X connect 48 0 49 0;
-#X connect 49 0 45 0;
-#X connect 50 0 46 0;
-#X connect 50 0 38 0;
-#X connect 50 1 48 0;
-#X connect 51 0 18 0;
-#X connect 51 1 17 0;
-#X connect 52 0 58 0;
-#X connect 53 0 55 0;
-#X connect 54 0 53 1;
-#X connect 55 0 66 1;
-#X connect 55 1 66 0;
-#X connect 57 0 56 0;
-#X connect 58 0 13 0;
-#X connect 58 0 53 0;
-#X connect 58 0 71 0;
-#X connect 59 0 65 0;
-#X connect 60 0 62 0;
-#X connect 61 0 63 0;
-#X connect 62 0 61 0;
-#X connect 63 0 64 0;
-#X connect 63 0 58 0;
-#X connect 65 0 62 0;
-#X connect 65 1 61 1;
-#X connect 66 0 68 1;
-#X connect 66 0 69 0;
-#X connect 68 0 67 0;
-#X connect 69 0 70 0;
-#X connect 70 0 75 0;
-#X connect 71 0 73 0;
-#X connect 72 0 71 1;
-#X connect 73 0 16 0;
-#X connect 73 1 74 0;
-#X connect 75 0 68 0;
-#X connect 76 0 20 1;
-#X connect 78 0 58 0;
-#X connect 79 0 58 0;
-#X connect 80 0 58 0;
+#X obj 316 61 float;
+#X obj 359 61 + 1;
+#X obj 316 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 402 59 bang;
+#X msg 335 27 1;
+#X obj 316 83 moses 5;
+#X obj 89 73 select 255;
+#X obj 223 150 * 128;
+#X obj 89 -1 inlet;
+#X obj 10 373 outlet;
+#X obj 235 380 outlet;
+#X obj 197 301 makefilename arduino%c;
+#X obj 89 45 comport \$1 9600;
+#X connect 3 0 5 0;
+#X connect 3 1 27 0;
+#X connect 4 0 3 0;
+#X connect 4 0 10 0;
+#X connect 5 0 6 0;
+#X connect 6 0 11 0;
+#X connect 6 1 7 1;
+#X connect 7 0 29 0;
+#X connect 8 0 9 0;
+#X connect 8 0 12 0;
+#X connect 9 0 8 1;
+#X connect 10 0 9 0;
+#X connect 11 0 8 0;
+#X connect 12 0 31 0;
+#X connect 13 0 14 0;
+#X connect 13 1 15 0;
+#X connect 13 2 16 0;
+#X connect 13 3 17 0;
+#X connect 18 0 13 1;
+#X connect 19 0 18 0;
+#X connect 20 0 25 0;
+#X connect 21 0 20 1;
+#X connect 22 0 20 0;
+#X connect 23 0 24 0;
+#X connect 24 0 20 0;
+#X connect 25 0 21 0;
+#X connect 25 0 13 0;
+#X connect 25 1 23 0;
+#X connect 26 0 4 0;
+#X connect 26 1 3 0;
+#X connect 27 0 5 1;
+#X connect 28 0 32 0;
+#X connect 31 0 7 0;
+#X connect 32 0 29 0;
|