aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Pd_firmware/Pd_firmware.pde247
-rw-r--r--arduino-test.pd450
-rw-r--r--arduino.pd228
3 files changed, 457 insertions, 468 deletions
diff --git a/Pd_firmware/Pd_firmware.pde b/Pd_firmware/Pd_firmware.pde
index 1a598be..ca8c79a 100644
--- a/Pd_firmware/Pd_firmware.pde
+++ b/Pd_firmware/Pd_firmware.pde
@@ -51,7 +51,7 @@
* TODO: use Program Control to load stored profiles from EEPROM
*/
-/* cvs version: $Id: Pd_firmware.pde,v 1.26 2007-03-05 04:34:32 eighthave Exp $ */
+/* cvs version: $Id: Pd_firmware.pde,v 1.27 2007-03-05 17:08:51 eighthave Exp $ */
/*==============================================================================
* MESSAGE FORMATS
@@ -173,16 +173,18 @@
* version numbers are important. This number can be queried so that host
* software can test whether it will be compatible with the currently
* installed firmware. */
-#define MAJOR_VERSION 1 // for non-compatible changes
-#define MINOR_VERSION 0 // for backwards compatible changes
+#define FIRMATA_MAJOR_VERSION 1 // for non-compatible changes
+#define FIRMATA_MINOR_VERSION 0 // for backwards compatible changes
/* total number of pins currently supported */
-#define TOTAL_ANALOG_PINS 6
-#define TOTAL_DIGITAL_PINS 14
+#define TOTAL_ANALOG_PINS 6
+#define TOTAL_DIGITAL_PINS 14
// for comparing along with INPUT and OUTPUT
-#define PWM 2
+#define PWM 2
+#define MAX_DATA_BYTES 2 // max number of data bytes in non-SysEx messages
+/* message command bytes */
#define DIGITAL_MESSAGE 0x90 // send data for a digital pin
#define ANALOG_MESSAGE 0xE0 // send data for an analog pin (or PWM)
//#define PULSE_MESSAGE 0xA0 // proposed pulseIn/Out message (SysEx)
@@ -199,51 +201,41 @@
* GLOBAL VARIABLES
*============================================================================*/
-// circular buffer for receiving bytes from the serial port
-#define RINGBUFFER_MAX 64 // must be a power of 2
-byte ringBuffer[RINGBUFFER_MAX];
-byte readPosition=0, writePosition=0;
-
-// maximum number of post-command data bytes (non-SysEx)
-#define MAX_DATA_BYTES 2
-// this flag says the next serial input will be data
-byte waitForData = 0;
+/* input message handling */
+byte waitForData = 0; // this flag says the next serial input will be data
byte executeMultiByteCommand = 0; // command to execute after getting multi-byte data
byte multiByteChannel = 0; // channel data for multiByteCommands
byte storedInputData[MAX_DATA_BYTES] = {0,0}; // multi-byte data
-
-byte previousDigitalInputHighByte = 0;
-byte previousDigitalInputLowByte = 0;
+/* digital pins */
+boolean digitalInputsEnabled = false; // output digital inputs or not
byte digitalInputHighByte = 0;
byte digitalInputLowByte = 0;
-unsigned int digitalPinStatus = 65535;// bit-wise array to store pin status 0=INPUT, 1=OUTPUT
-/* 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 = 0;
-
+byte previousDigitalInputHighByte = 0; // previous output to test for change
+byte previousDigitalInputLowByte = 0; // previous output to test for change
+int digitalPinStatus = 0; // bitwise array to store pin status 0=INPUT,1=OUTPUT
+/* PWM/analog outputs */
+int pwmStatus = 0; // bitwise array to store PWM status
/* analog inputs */
-unsigned int analogPinsToReport = 0; // bit-wise array to store pin reporting
+unsigned int analogPinsToReport = 0; // bitwise array to store pin reporting
int analogPin = 0; // counter for reading analog pins
int analogData; // storage variable for data from analogRead()
-/* interrupt variables */
-volatile int int_counter = 0; // ms counter for scheduling
+/* timer variables */
+extern volatile unsigned long timer0_overflow_count; // timer0 from wiring.c
+unsigned long nextExecuteTime; // for comparison with timer0_overflow_count
/*==============================================================================
* FUNCTIONS
*============================================================================*/
/* -----------------------------------------------------------------------------
- * output the version message to the serial port
- */
+ * output the version message to the serial port */
void printVersion() {
Serial.print(REPORT_VERSION, BYTE);
- Serial.print(MINOR_VERSION, BYTE);
- Serial.print(MAJOR_VERSION, BYTE);
+ Serial.print(FIRMATA_MINOR_VERSION, BYTE);
+ Serial.print(FIRMATA_MAJOR_VERSION, BYTE);
}
/* -----------------------------------------------------------------------------
- * output digital bytes received from the serial port
- */
+ * output digital bytes received from the serial port */
void outputDigitalBytes(byte pin0_6, byte pin7_13) {
int i;
int mask;
@@ -260,9 +252,54 @@ void outputDigitalBytes(byte pin0_6, byte pin7_13) {
}
/* -----------------------------------------------------------------------------
- * processInput() is called whenever a byte is available on the
- * Arduino's serial port. This is where the commands are handled.
+ * check all the active digital inputs for change of state, then add any events
+ * to the Serial output queue using Serial.print() */
+void checkDigitalInputs(void) {
+ if(digitalInputsEnabled) {
+ // this should use _SFR_IO8()
+ }
+}
+
+// -----------------------------------------------------------------------------
+/* 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(byte pin, byte mode) {
+ if(mode == INPUT) {
+ digitalPinStatus = digitalPinStatus &~ (1 << pin);
+ pwmStatus = pwmStatus &~ (1 << pin);
+ digitalWrite(pin,LOW); // turn off pin before switching to INPUT
+ pinMode(pin,INPUT);
+ }
+ else if(mode == OUTPUT) {
+ digitalPinStatus = digitalPinStatus | (1 << pin);
+ pwmStatus = pwmStatus &~ (1 << pin);
+ pinMode(pin,OUTPUT);
+ }
+ else if( mode == PWM ) {
+ digitalPinStatus = digitalPinStatus | (1 << pin);
+ pwmStatus = pwmStatus | (1 << pin);
+ pinMode(pin,OUTPUT);
+ }
+ // TODO: save status to EEPROM here, if changed
+}
+
+// -----------------------------------------------------------------------------
+/* sets bits in a bit array (int) to toggle the reporting of the analogIns
+ */
+void setAnalogPinReporting(byte pin, byte state) {
+ if(state == 0) {
+ analogPinsToReport = analogPinsToReport &~ (1 << pin);
+ }
+ else { // everything but 0 enables reporting of that pin
+ analogPinsToReport = analogPinsToReport | (1 << pin);
+ }
+ // TODO: save status to EEPROM here, if changed
+}
+
+/* -----------------------------------------------------------------------------
+ * processInput() is called whenever a byte is available on the
+ * Arduino's serial port. This is where the commands are handled. */
void processInput(int inputData) {
int command;
@@ -270,27 +307,30 @@ void processInput(int inputData) {
if( (waitForData > 0) && (inputData < 128) ) {
waitForData--;
storedInputData[waitForData] = inputData;
- if( (waitForData==0) && executeMultiByteCommand ) {
- //we got everything
+ if( (waitForData==0) && executeMultiByteCommand ) { // got the whole message
switch(executeMultiByteCommand) {
case ANALOG_MESSAGE:
+ setPinMode(multiByteChannel,PWM);
+ analogWrite(multiByteChannel,
+ (storedInputData[0] << 7) + storedInputData[1] );
break;
case DIGITAL_MESSAGE:
outputDigitalBytes(storedInputData[1], storedInputData[0]); //(LSB, MSB)
break;
case SET_DIGITAL_PIN_MODE:
setPinMode(storedInputData[1], storedInputData[0]); // (pin#, mode)
- //if(storedInputData[0] == INPUT) // enable input if set to INPUT
- // TODO: enable REPORT_DIGITAL_PORTS
+ if(storedInputData[0] == INPUT)
+ digitalInputsEnabled = true; // enable reporting of digital inputs
break;
case REPORT_ANALOG_PIN:
setAnalogPinReporting(multiByteChannel,storedInputData[0]);
- //Serial.print(multiByteChannel,BYTE);
- //Serial.print(storedInputData[0],BYTE);
- //Serial.print(analogPinsToReport,BYTE);
- //Serial.print(analogPinsToReport & (1 << multiByteChannel),BYTE);
break;
case REPORT_DIGITAL_PORTS:
+ // TODO: implement MIDI channel as port base for more than 16 digital inputs
+ if(storedInputData[0] == 0)
+ digitalInputsEnabled = false;
+ else
+ digitalInputsEnabled = true;
break;
}
executeMultiByteCommand = 0;
@@ -326,59 +366,16 @@ void processInput(int inputData) {
}
}
-
/* -----------------------------------------------------------------------------
* this function checks to see if there is data waiting on the serial port
* then processes all of the stored data
*/
-
-/* TODO: switch this to a timer interrupt. The timer is set in relation to
- * the bitrate, when the interrupt is triggered, then it runs checkForInput().
- * Therefore, it only checks for input once per cycle of the serial port.
- */
-void checkForInput() {
+void checkForSerialReceive() {
while(Serial.available())
- processInput( Serial.read() );
-}
-
-// -----------------------------------------------------------------------------
-/* 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(byte pin, byte mode) {
- if(mode == INPUT) {
- digitalPinStatus = digitalPinStatus &~ (1 << pin);
- pwmStatus = pwmStatus &~ (1 << pin);
- digitalWrite(pin,LOW); // turn off pin before switching to INPUT
- pinMode(pin,INPUT);
- }
- else if(mode == OUTPUT) {
- digitalPinStatus = digitalPinStatus | (1 << pin);
- pwmStatus = pwmStatus &~ (1 << pin);
- pinMode(pin,OUTPUT);
- }
- else if( mode == PWM ) {
- digitalPinStatus = digitalPinStatus | (1 << pin);
- pwmStatus = pwmStatus | (1 << pin);
- pinMode(pin,OUTPUT);
- }
- // TODO: save status to EEPROM here, if changed
-}
-
-// -----------------------------------------------------------------------------
-/* sets bits in a bit array (int) to toggle the reporting of the analogIns
- */
-void setAnalogPinReporting(byte pin, byte state) {
- if(state == 0) {
- analogPinsToReport = analogPinsToReport &~ (1 << pin);
- }
- else { // everything but 0 enables reporting of that pin
- analogPinsToReport = analogPinsToReport | (1 << pin);
- }
+ processInput(Serial.read());
}
// =============================================================================
-
// used for flashing the pin for the version number
void pin13strobe(int count, int onInterval, int offInterval) {
byte i;
@@ -391,80 +388,57 @@ void pin13strobe(int count, int onInterval, int offInterval) {
}
}
-// -----------------------------------------------------------------------------
-/* handle timer interrupts - Arduino runs at 16 Mhz, so we have 1000 Overflows
- * per second... 1/ ((16000000 / 64) / 256) = 1 / 1000 */
-ISR(TIMER2_OVF_vect) {
- int_counter++;
-};
-
/*==============================================================================
* SETUP()
*============================================================================*/
void setup() {
byte i;
- // TODO: load state from EEPROM here
Serial.begin(57600); // 9600, 14400, 38400, 57600, 115200
- /* set up timer interrupt */
- //Timer2 Settings: Timer Prescaler /64,
- TCCR2 |= (1<<CS22);
- TCCR2 &= ~((1<<CS21) | (1<<CS20));
- // Use normal mode
- TCCR2 &= ~((1<<WGM21) | (1<<WGM20));
- // Use internal clock - external clock not used in Arduino
- ASSR |= (0<<AS2);
- //Timer2 Overflow Interrupt Enable
- TIMSK |= (1<<TOIE2) | (0<<OCIE2);
-// RESET_TIMER2;
- sei();
-
-
- /* TODO: send digital inputs here, if enabled, to set the initial state on the
- * host computer, since once in the loop(), the Arduino will only send data on
- * change. */
-
- // flash the pin 13 with the protocol minor version (add major once > 0)
+ // flash the pin 13 with the protocol version
pinMode(13,OUTPUT);
pin13strobe(2,1,4); // separator, a quick burst
delay(500);
- pin13strobe(MAJOR_VERSION, 200, 400);
+ pin13strobe(FIRMATA_MAJOR_VERSION, 200, 400);
delay(500);
pin13strobe(2,1,4); // separator, a quick burst
delay(500);
- pin13strobe(MINOR_VERSION, 200, 400);
+ pin13strobe(FIRMATA_MINOR_VERSION, 200, 400);
delay(500);
pin13strobe(2,1,4); // separator, a quick burst
- printVersion();
for(i=0; i<TOTAL_DIGITAL_PINS; ++i) {
- setPinMode(i,OUTPUT);
+ setPinMode(i,INPUT);
}
+ // TODO: load state from EEPROM here
+
+ printVersion();
+
+ /* TODO: send digital inputs here, if enabled, to set the initial state on the
+ * host computer, since once in the loop(), the Arduino will only send data on
+ * change. */
}
/*==============================================================================
* LOOP()
*============================================================================*/
void loop() {
-
+ ///analogWrite(11, tmp);++tmp;delay(2);
/* DIGITALREAD - as fast as possible, check for changes and output them to the
- * FTDI buffer using serialWrite) */
-// this should use _SFR_IO8()
-
- if(int_counter > 3) { // run this every 4ms
-
-
-/* SERIALREAD - Serial.read() uses a 128 byte circular buffer, so handle all
- * serialReads at once, i.e. empty the buffer */
- checkForInput();
-
-/* SEND FTDI WRITE BUFFER - make sure that the FTDI buffer doesn't go over 60
- * bytes. use a timer to sending an event character every 4 ms to trigger the
- * buffer to dump. */
-
-/* ANALOGREAD - right after the event character, do all of the analogReads().
- * These only need to be done every 4ms. */
+ * FTDI buffer using Serial.print() */
+ checkDigitalInputs();
+ if(timer0_overflow_count > nextExecuteTime) {
+ nextExecuteTime = timer0_overflow_count + 4; // run this every 4ms
+ /* SERIALREAD - Serial.read() uses a 128 byte circular buffer, so handle
+ * all serialReads at once, i.e. empty the buffer */
+ checkForSerialReceive();
+ /* SEND FTDI WRITE BUFFER - make sure that the FTDI buffer doesn't go over
+ * 60 bytes. use a timer to sending an event character every 4 ms to
+ * trigger the buffer to dump. */
+
+ /* ANALOGREAD - right after the event character, do all of the
+ * analogReads(). These only need to be done every 4ms. */
for(analogPin=0;analogPin<TOTAL_ANALOG_PINS;analogPin++) {
if( analogPinsToReport & (1 << analogPin) ) {
analogData = analogRead(analogPin);
@@ -474,6 +448,5 @@ void loop() {
Serial.print(analogData >> 7, BYTE);
}
}
- int_counter = 0; // reset ms counter
}
}
diff --git a/arduino-test.pd b/arduino-test.pd
index b2fe913..e8638c9 100644
--- a/arduino-test.pd
+++ b/arduino-test.pd
@@ -1,8 +1,8 @@
-#N canvas 216 76 703 544 10;
+#N canvas 206 22 667 540 10;
#X obj 512 7 import hardware mapping;
#X obj 323 136 cnv 15 100 22 empty empty empty 20 12 0 14 -253938 -66577
0;
-#X obj 73 165 cnv 15 70 22 empty empty empty 20 12 0 14 -253938 -66577
+#X obj 33 165 cnv 15 70 22 empty empty empty 20 12 0 14 -253938 -66577
0;
#X obj 155 190 cnv 15 60 22 empty empty empty 20 12 0 14 -253938 -66577
0;
@@ -36,16 +36,14 @@
#X coords 0 -1 1 1 136 17 1 60 60;
#X restore 161 169 pd serin;
#X text 158 151 serial port #;
-#X text 418 514 released under the GNU GPL;
-#X text 2 514 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
-;
+#X text 420 513 released under the GNU GPL;
#X msg 221 192 close;
-#X obj 581 328 tgl 15 0 empty empty changes 0 -6 0 8 -262144 -1 -1
+#X obj 532 330 tgl 15 0 empty empty changes 0 -6 0 8 -262144 -1 -1
0 1;
-#X obj 520 328 tgl 15 0 empty empty all 0 -6 0 8 -262144 -1 -1 0 1
+#X obj 479 330 tgl 15 0 empty empty all 0 -6 0 8 -262144 -1 -1 0 1
;
-#X obj 138 119 hsl 150 17 0 1 0 0 empty empty PWM_control_(0-1) -2
--6 1 10 -225271 -1 -1 8800 0;
+#X obj 98 119 hsl 150 17 0 1 0 0 empty empty PWM_control_(0-1) -2 -6
+1 10 -225271 -1 -1 0 0;
#X obj 277 332 tgl 15 1 empty empty empty 0 -6 0 8 -225271 -1 -1 0
1;
#X text 454 156 how many analogIns to enable:;
@@ -53,85 +51,102 @@
1;
#X text 478 216 enable/disable digitalIns;
#X msg 455 235 digitalIns \$1;
-#X msg 455 193 analogIns 0;
-#N canvas 162 133 570 420 serin 0;
-#X obj 165 61 cnv 15 15 15 empty \$0-analog-number-canvas 0 4 8 0 14
--233017 -1 0;
-#X obj 60 61 hradio 15 1 1 7 empty empty empty 0 -6 0 8 -225280 -1
--1 0;
-#X obj 60 13 inlet;
-#X msg 200 202 label \$1;
-#X obj 200 180 makefilename %d;
-#X obj 59 108 int;
-#X obj 200 225 send \$0-analog-number-canvas;
+#X msg 455 193 analogIns 1 0;
+#N canvas 162 133 610 460 serin 0;
#X obj 59 337 outlet;
-#X msg 60 210 analogIns \$1;
-#X msg 201 306 set \$1 \$2;
#X obj 59 266 trigger bang anything;
#X obj 201 286 list;
-#X connect 1 0 5 0;
-#X connect 2 0 1 0;
-#X connect 3 0 6 0;
-#X connect 4 0 3 0;
-#X connect 5 0 4 0;
-#X connect 5 0 8 0;
-#X connect 8 0 10 0;
-#X connect 9 0 7 0;
-#X connect 10 0 7 0;
-#X connect 10 1 11 0;
-#X connect 11 0 9 0;
-#X coords 0 -1 1 1 121 17 1 60 60;
+#X obj 60 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 0 5 9
+1 12 -262130 -1 -1 0 1;
+#X obj 75 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 1 5 9
+1 12 -262130 -1 -1 0 1;
+#X obj 90 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 2 5 9
+1 12 -262130 -1 -1 0 1;
+#X obj 105 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 3 5 9
+1 12 -262130 -1 -1 0 1;
+#X obj 120 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 4 5 9
+1 12 -262130 -1 -1 0 1;
+#X obj 135 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 5 5 9
+1 12 -262130 -1 -1 0 1;
+#X obj 150 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 6 5 9
+1 12 -262130 -1 -1 0 1;
+#X obj 165 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 7 5 9
+1 12 -262130 -1 -1 0 1;
+#X msg 59 210 analogIns \$1 \$2;
+#X msg 35 106 0 \$1;
+#X msg 70 106 1 \$1;
+#X msg 105 106 2 \$1;
+#X msg 140 106 3 \$1;
+#X msg 175 106 4 \$1;
+#X msg 210 106 5 \$1;
+#X msg 245 106 6 \$1;
+#X msg 280 106 7 \$1;
+#X msg 202 307 set \$1 \$2 \$3;
+#X connect 1 0 0 0;
+#X connect 1 1 2 0;
+#X connect 2 0 20 0;
+#X connect 3 0 12 0;
+#X connect 4 0 13 0;
+#X connect 5 0 14 0;
+#X connect 6 0 15 0;
+#X connect 7 0 16 0;
+#X connect 8 0 17 0;
+#X connect 9 0 18 0;
+#X connect 10 0 19 0;
+#X connect 11 0 1 0;
+#X connect 12 0 11 0;
+#X connect 13 0 11 0;
+#X connect 14 0 11 0;
+#X connect 15 0 11 0;
+#X connect 16 0 11 0;
+#X connect 17 0 11 0;
+#X connect 18 0 11 0;
+#X connect 19 0 11 0;
+#X connect 20 0 0 0;
+#X coords 0 -1 1 1 120 16 1 60 60;
#X restore 455 173 pd serin;
-#N canvas 77 268 478 328 debugging 0;
+#N canvas 77 268 486 336 debugging 0;
#X obj 136 31 inlet;
#X obj 324 29 inlet;
#X obj 27 31 inlet;
-#X obj 162 81 spigot;
-#X obj 159 106 select 255;
-#X obj 184 246 print;
-#X obj 184 227 list;
-#X obj 43 115 spigot;
-#X obj 210 201 bang;
-#X obj 181 138 mapping/tolist;
-#X obj 208 181 change;
-#X obj 208 159 list-abs/list-len;
-#X obj 43 136 print DEBUG;
-#N canvas 146 22 466 316 DEBUG 0;
-#X msg 142 19 open 1;
-#X msg 200 20 close;
-#X msg 52 82 pinMode 13 1;
-#X msg 15 137 digital 13 \$1;
-#X obj 15 119 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
-;
-#X msg 271 93 213;
-#X obj 289 123 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-127;
-#X floatatom 309 123 5 0 0 0 - - -;
-#X msg 250 63 150 \, 160;
-#X text 311 62 turn off input;
-#X msg 284 145 229 \, \$1 \, \$1;
-#X msg 318 249 64;
-#X msg 304 180 229 \, 127 \, 127;
-#X msg 304 210 229 \, 0 \, 0;
-#X obj 193 267 arduino 1;
-#X connect 0 0 14 0;
-#X connect 1 0 14 0;
-#X connect 2 0 14 0;
-#X connect 3 0 14 0;
-#X connect 4 0 3 0;
-#X connect 5 0 14 1;
-#X connect 6 0 10 0;
-#X connect 6 0 7 0;
-#X connect 8 0 14 1;
-#X connect 10 0 14 1;
-#X connect 11 0 14 1;
-#X connect 12 0 14 1;
-#X connect 13 0 14 1;
-#X restore 363 269 pd DEBUG;
+#X obj 212 81 spigot;
+#X obj 209 106 select 255;
+#X obj 234 246 print;
+#X obj 234 227 list;
+#X obj 93 115 spigot;
+#X obj 260 201 bang;
+#X obj 231 138 mapping/tolist;
+#X obj 258 181 change;
+#X obj 258 159 list-abs/list-len;
+#X obj 93 136 print DEBUG;
+#N canvas 0 22 478 328 measure 0;
+#X obj 93 18 inlet;
+#X obj 93 260 outlet;
+#X obj 93 129 purepd/alternate;
+#X obj 93 175 timer;
+#X obj 186 150 bang;
+#X obj 93 150 bang;
+#X obj 200 20 tgl 18 0 empty empty empty 0 -6 0 10 -232576 -1 -1 0
+1;
+#X obj 93 56 spigot 0;
+#X obj 93 94 select 224;
+#X connect 0 0 7 0;
+#X connect 2 0 5 0;
+#X connect 2 1 4 0;
+#X connect 3 0 1 0;
+#X connect 4 0 3 1;
+#X connect 5 0 3 0;
+#X connect 6 0 7 1;
+#X connect 7 0 8 0;
+#X connect 8 0 2 0;
+#X coords 0 -1 1 1 85 18 1 200 20;
+#X restore 19 178 pd measure;
+#X floatatom 19 201 8 0 0 0 - - -;
#X connect 0 0 7 1;
#X connect 1 0 3 1;
#X connect 2 0 7 0;
#X connect 2 0 3 0;
+#X connect 2 0 13 0;
#X connect 3 0 4 0;
#X connect 4 0 9 1;
#X connect 4 1 9 0;
@@ -142,7 +157,8 @@
#X connect 9 0 11 0;
#X connect 10 0 8 0;
#X connect 11 0 10 0;
-#X restore 460 346 pd debugging stuff;
+#X connect 13 0 14 0;
+#X restore 427 348 pd debugging stuff;
#X floatatom 22 446 5 0 0 3 a0 - -;
#X floatatom 68 446 5 0 0 3 a1 - -;
#X floatatom 114 446 5 0 0 3 a2 - -;
@@ -150,24 +166,24 @@
#X floatatom 206 446 5 0 0 3 a4 - -;
#X floatatom 252 446 5 0 0 3 a5 - -;
#X text 300 311 <- argument sets port #;
-#X msg 102 119 off;
-#X obj 80 91 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124 -1
--1 11;
-#X text 188 77 7;
-#X text 82 77 0;
-#X text 229 77 10;
-#X text 275 77 13;
-#X text 142 77 4;
-#X text 111 77 2;
-#X text 156 77 5;
-#X text 171 77 6;
-#X text 127 77 3;
-#X text 202 77 8;
-#X text 219 77 9;
-#X text 245 77 11;
-#X text 260 77 12;
-#X text 97 77 1;
-#N canvas 66 58 419 499 pwm 0;
+#X msg 62 119 off;
+#X obj 40 91 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124 -1
+-1 9;
+#X text 148 77 7;
+#X text 42 77 0;
+#X text 189 77 10;
+#X text 235 77 13;
+#X text 102 77 4;
+#X text 71 77 2;
+#X text 116 77 5;
+#X text 131 77 6;
+#X text 87 77 3;
+#X text 162 77 8;
+#X text 179 77 9;
+#X text 205 77 11;
+#X text 220 77 12;
+#X text 57 77 1;
+#N canvas 66 58 423 503 pwm 0;
#X obj 38 10 inlet;
#X obj 131 10 inlet;
#X msg 37 308 pwm \$1 \$2;
@@ -207,11 +223,10 @@
#X connect 15 1 16 0;
#X connect 16 0 17 0;
#X connect 17 0 14 0;
-#X restore 81 145 pd pwm;
-#X msg 81 167 pwm 11 0.590604;
+#X restore 41 145 pd pwm;
+#X msg 41 167 pwm 9 0;
#X msg 328 195 info;
#X msg 367 195 version;
-#X obj 468 422 print [arduino]_VERSION;
#X obj 230 332 spigot;
#X text 13 6 The [arduino] object works with the Firmata firmware for
Arduino (previously known as Pduino firmware).;
@@ -294,27 +309,27 @@ Arduino (previously known as Pduino firmware).;
#X connect 30 1 29 0;
#X restore 329 116 pd send-to-arduino----------------;
#X text 328 64 turn on output mode for each pin (off=input);
-#X msg 329 138 pinMode 13 0;
-#N canvas 101 54 455 332 sending 0;
+#X msg 329 138 pinMode 12 0;
+#N canvas 101 54 463 340 sending 0;
#X obj 69 158 cnv 15 100 22 empty empty empty 20 12 0 14 -253938 -66577
0;
#X obj 78 244 outlet;
-#X msg 78 161 digital 0 0;
-#X obj 197 98 tgl 15 0 empty empty 7 4 -6 1 12 -233017 -1 -1 0 1;
-#X obj 214 98 tgl 15 0 empty empty 8 4 -6 1 12 -233017 -1 -1 0 1;
-#X obj 231 98 tgl 15 0 empty empty 9 4 -6 1 12 -233017 -1 -1 0 1;
-#X obj 248 98 tgl 15 0 empty empty 10 0 -6 1 12 -233017 -1 -1 0 1;
-#X obj 265 98 tgl 15 0 empty empty 11 0 -6 1 12 -233017 -1 -1 0 1;
-#X obj 282 98 tgl 15 0 empty empty 12 0 -6 1 12 -233017 -1 -1 0 1;
-#X obj 299 98 tgl 15 0 empty empty 13 0 -6 1 12 -233017 -1 -1 0 1;
-#X obj 78 98 tgl 15 0 empty empty 0 4 -6 1 12 -233017 -1 -1 0 1;
-#X obj 95 98 tgl 15 0 empty empty 1 4 -6 1 12 -233017 -1 -1 0 1;
-#X obj 112 98 tgl 15 0 empty empty 2 4 -6 1 12 -233017 -1 -1 0 1;
-#X obj 129 98 tgl 15 0 empty empty 3 4 -6 1 12 -233017 -1 -1 0 1;
-#X obj 146 98 tgl 15 0 empty empty 5 4 -6 1 12 -233017 -1 -1 0 1;
-#X obj 163 98 tgl 15 0 empty empty 6 4 -6 1 12 -233017 -1 -1 0 1;
-#X obj 180 98 tgl 15 0 empty empty 7 4 -6 1 12 -233017 -1 -1 0 1;
-#N canvas 486 328 798 348 generate 0;
+#X msg 78 161 digital 0 1;
+#X obj 197 98 tgl 15 0 empty empty 7 4 -6 1 12 -233017 -1 -1 1 1;
+#X obj 214 98 tgl 15 0 empty empty 8 4 -6 1 12 -233017 -1 -1 1 1;
+#X obj 231 98 tgl 15 0 empty empty 9 4 -6 1 12 -233017 -1 -1 1 1;
+#X obj 248 98 tgl 15 0 empty empty 10 0 -6 1 12 -233017 -1 -1 1 1;
+#X obj 265 98 tgl 15 0 empty empty 11 0 -6 1 12 -233017 -1 -1 1 1;
+#X obj 282 98 tgl 15 0 empty empty 12 0 -6 1 12 -233017 -1 -1 1 1;
+#X obj 299 98 tgl 15 0 empty empty 13 0 -6 1 12 -233017 -1 -1 1 1;
+#X obj 78 98 tgl 15 0 empty empty 0 4 -6 1 12 -233017 -1 -1 1 1;
+#X obj 95 98 tgl 15 0 empty empty 1 4 -6 1 12 -233017 -1 -1 1 1;
+#X obj 112 98 tgl 15 0 empty empty 2 4 -6 1 12 -233017 -1 -1 1 1;
+#X obj 129 98 tgl 15 0 empty empty 3 4 -6 1 12 -233017 -1 -1 1 1;
+#X obj 146 98 tgl 15 0 empty empty 5 4 -6 1 12 -233017 -1 -1 1 1;
+#X obj 163 98 tgl 15 0 empty empty 6 4 -6 1 12 -233017 -1 -1 1 1;
+#X obj 180 98 tgl 15 0 empty empty 7 4 -6 1 12 -233017 -1 -1 1 1;
+#N canvas 482 328 802 352 generate 0;
#X obj 49 24 inlet;
#X obj 89 24 inlet;
#X obj 128 24 inlet;
@@ -378,7 +393,7 @@ Arduino (previously known as Pduino firmware).;
#X connect 30 0 29 0;
#X connect 30 1 29 0;
#X restore 78 122 pd generate digital out messages;
-#X obj 348 73 tgl 25 0 empty empty ALL 2 12 0 12 -262144 -1 -1 0 1
+#X obj 348 73 tgl 25 0 empty empty ALL 2 12 0 12 -262144 -1 -1 1 1
;
#X obj 349 34 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 16383
;
@@ -468,104 +483,131 @@ Arduino (previously known as Pduino firmware).;
#X connect 21 0 22 0;
#X connect 22 0 23 0;
#X restore 45 420 pd display values without pegging the CPU;
-#X obj 397 402 route digital version;
+#X obj 397 389 route digital version;
#X obj 397 446 route 0 1 2 3 4 5 6 7 8 9 10 11 12 13;
-#X obj 415 468 tgl 15 0 empty empty 1 4 23 1 12 -232448 -1 -1 0 1;
-#X obj 433 468 tgl 15 0 empty empty 2 4 23 1 12 -232448 -1 -1 0 1;
-#X obj 451 468 tgl 15 0 empty empty 3 4 23 1 12 -232448 -1 -1 0 1;
-#X obj 469 468 tgl 15 0 empty empty 4 4 23 1 12 -232448 -1 -1 0 1;
-#X obj 487 468 tgl 15 0 empty empty 5 4 23 1 12 -232448 -1 -1 0 1;
-#X obj 505 468 tgl 15 0 empty empty 6 4 23 1 12 -232448 -1 -1 0 1;
-#X obj 523 468 tgl 15 0 empty empty 7 4 23 1 12 -232448 -1 -1 0 1;
-#X obj 541 468 tgl 15 0 empty empty 8 4 23 1 12 -232448 -1 -1 0 1;
-#X obj 559 468 tgl 15 0 empty empty 9 4 23 1 12 -232448 -1 -1 0 1;
-#X obj 577 468 tgl 15 0 empty empty 10 0 23 1 12 -232448 -1 -1 0 1
+#X obj 414 468 tgl 15 0 empty empty 1 4 23 1 12 -232448 -1 -1 0 1;
+#X obj 431 468 tgl 15 0 empty empty 2 4 23 1 12 -232448 -1 -1 0 1;
+#X obj 448 468 tgl 15 0 empty empty 3 4 23 1 12 -232448 -1 -1 0 1;
+#X obj 465 468 tgl 15 0 empty empty 4 4 23 1 12 -232448 -1 -1 0 1;
+#X obj 482 468 tgl 15 0 empty empty 5 4 23 1 12 -232448 -1 -1 0 1;
+#X obj 499 468 tgl 15 0 empty empty 6 4 23 1 12 -232448 -1 -1 0 1;
+#X obj 516 468 tgl 15 0 empty empty 7 4 23 1 12 -232448 -1 -1 0 1;
+#X obj 533 468 tgl 15 0 empty empty 8 4 23 1 12 -232448 -1 -1 0 1;
+#X obj 550 468 tgl 15 0 empty empty 9 4 23 1 12 -232448 -1 -1 0 1;
+#X obj 567 468 tgl 15 0 empty empty 10 0 23 1 12 -232448 -1 -1 0 1
;
-#X obj 595 468 tgl 15 0 empty empty 11 0 23 1 12 -232448 -1 -1 0 1
+#X obj 584 468 tgl 15 0 empty empty 11 0 23 1 12 -232448 -1 -1 0 1
;
-#X obj 613 468 tgl 15 0 empty empty 12 0 23 1 12 -232448 -1 -1 0 1
+#X obj 601 468 tgl 15 0 empty empty 12 0 23 1 12 -232448 -1 -1 0 1
;
-#X obj 631 468 tgl 15 0 empty empty 13 0 23 1 12 -232448 -1 -1 0 1
+#X obj 618 468 tgl 15 0 empty empty 13 0 23 1 12 -232448 -1 -1 0 1
;
#X obj 397 468 tgl 15 0 empty empty 0 4 23 1 12 -232448 -1 -1 0 1;
#N canvas 0 22 454 304 raw 0;
#X obj 96 231 outlet;
#X obj 96 63 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 10 -262144
--1 -1 2500 1;
+-1 -1 0 1;
#X msg 90 139 171 \, \$1 \, 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X restore 374 292 pd raw PWM;
-#X connect 4 0 71 0;
+#X text 2 514 (C) Copyright 2006 Free Software Foundation;
+#N canvas 0 22 443 216 ver 0;
+#X obj 23 7 inlet;
+#X obj 250 100 cnv 15 145 17 empty \$0-version_cnv firmata_version_1.0
+4 10 0 12 -203904 -1 0;
+#X obj 23 157 send \$0-version_cnv;
+#X msg 23 132 label \$1;
+#X obj 23 52 zexy/makesymbol firmata_version_%s.%s;
+#X obj 48 103 symbol;
+#X obj 38 77 loadbang;
+#X msg 96 78 bang;
+#X obj 23 29 route version;
+#X connect 0 0 8 0;
+#X connect 3 0 2 0;
+#X connect 4 0 3 0;
+#X connect 5 0 3 0;
+#X connect 6 0 5 0;
+#X connect 7 0 5 0;
+#X connect 8 0 4 0;
+#X coords 0 -1 1 1 145 17 1 250 100;
+#X restore 74 351 pd ver;
+#X obj 456 409 unpack 0 0;
+#X floatatom 456 429 5 0 0 0 - - -;
+#X floatatom 513 429 5 0 0 0 - - -;
+#X connect 4 0 69 0;
#X connect 5 0 4 0;
-#X connect 9 0 71 0;
-#X connect 10 0 20 2;
-#X connect 11 0 20 1;
-#X connect 12 0 44 1;
-#X connect 13 0 49 1;
-#X connect 15 0 17 0;
-#X connect 17 0 71 0;
-#X connect 18 0 71 0;
-#X connect 19 0 18 0;
-#X connect 28 0 44 1;
-#X connect 29 0 44 0;
-#X connect 44 0 45 0;
-#X connect 45 0 71 0;
-#X connect 46 0 71 0;
-#X connect 47 0 71 0;
-#X connect 49 0 74 0;
-#X connect 51 0 65 1;
-#X connect 52 0 65 2;
-#X connect 53 0 65 3;
-#X connect 54 0 65 4;
-#X connect 55 0 65 5;
-#X connect 56 0 65 6;
-#X connect 57 0 65 7;
-#X connect 58 0 65 8;
-#X connect 59 0 65 9;
-#X connect 60 0 65 10;
-#X connect 61 0 65 11;
-#X connect 62 0 65 12;
-#X connect 63 0 65 13;
-#X connect 64 0 65 0;
-#X connect 65 0 67 0;
-#X connect 67 0 71 0;
-#X connect 68 0 71 0;
-#X connect 69 0 68 0;
-#X connect 71 0 49 0;
-#X connect 71 1 20 0;
-#X connect 74 0 75 0;
-#X connect 74 1 77 0;
+#X connect 8 0 69 0;
+#X connect 9 0 19 2;
+#X connect 10 0 19 1;
+#X connect 11 0 43 1;
+#X connect 12 0 47 1;
+#X connect 14 0 16 0;
+#X connect 16 0 69 0;
+#X connect 17 0 69 0;
+#X connect 18 0 17 0;
+#X connect 27 0 43 1;
+#X connect 28 0 43 0;
+#X connect 43 0 44 0;
+#X connect 44 0 69 0;
+#X connect 45 0 69 0;
+#X connect 46 0 69 0;
+#X connect 47 0 72 0;
+#X connect 49 0 63 1;
+#X connect 50 0 63 2;
+#X connect 51 0 63 3;
+#X connect 52 0 63 4;
+#X connect 53 0 63 5;
+#X connect 54 0 63 6;
+#X connect 55 0 63 7;
+#X connect 56 0 63 8;
+#X connect 57 0 63 9;
+#X connect 58 0 63 10;
+#X connect 59 0 63 11;
+#X connect 60 0 63 12;
+#X connect 61 0 63 13;
+#X connect 62 0 63 0;
+#X connect 63 0 65 0;
+#X connect 65 0 69 0;
+#X connect 66 0 69 0;
+#X connect 67 0 66 0;
+#X connect 69 0 47 0;
+#X connect 69 0 93 0;
+#X connect 69 1 19 0;
+#X connect 72 0 73 0;
+#X connect 72 1 75 0;
+#X connect 73 0 74 0;
+#X connect 73 1 74 1;
+#X connect 73 2 74 2;
+#X connect 73 3 74 3;
+#X connect 73 4 74 4;
+#X connect 73 5 74 5;
+#X connect 73 6 74 6;
+#X connect 73 7 74 7;
+#X connect 74 0 20 0;
+#X connect 74 1 21 0;
+#X connect 74 2 22 0;
+#X connect 74 3 23 0;
+#X connect 74 4 24 0;
+#X connect 74 5 25 0;
+#X connect 74 6 70 0;
+#X connect 74 7 71 0;
#X connect 75 0 76 0;
-#X connect 75 1 76 1;
-#X connect 75 2 76 2;
-#X connect 75 3 76 3;
-#X connect 75 4 76 4;
-#X connect 75 5 76 5;
-#X connect 75 6 76 6;
-#X connect 75 7 76 7;
-#X connect 76 0 21 0;
-#X connect 76 1 22 0;
-#X connect 76 2 23 0;
-#X connect 76 3 24 0;
-#X connect 76 4 25 0;
-#X connect 76 5 26 0;
-#X connect 76 6 72 0;
-#X connect 76 7 73 0;
-#X connect 77 0 78 0;
-#X connect 77 1 48 0;
-#X connect 78 0 92 0;
-#X connect 78 1 79 0;
-#X connect 78 2 80 0;
-#X connect 78 3 81 0;
-#X connect 78 4 82 0;
-#X connect 78 5 83 0;
-#X connect 78 6 84 0;
-#X connect 78 7 85 0;
-#X connect 78 8 86 0;
-#X connect 78 9 87 0;
-#X connect 78 10 88 0;
-#X connect 78 11 89 0;
-#X connect 78 12 90 0;
-#X connect 78 13 91 0;
-#X connect 93 0 71 1;
+#X connect 75 1 94 0;
+#X connect 76 0 90 0;
+#X connect 76 1 77 0;
+#X connect 76 2 78 0;
+#X connect 76 3 79 0;
+#X connect 76 4 80 0;
+#X connect 76 5 81 0;
+#X connect 76 6 82 0;
+#X connect 76 7 83 0;
+#X connect 76 8 84 0;
+#X connect 76 9 85 0;
+#X connect 76 10 86 0;
+#X connect 76 11 87 0;
+#X connect 76 12 88 0;
+#X connect 76 13 89 0;
+#X connect 91 0 69 1;
+#X connect 94 0 95 0;
+#X connect 94 1 96 0;
diff --git a/arduino.pd b/arduino.pd
index bd3a913..fb5a329 100644
--- a/arduino.pd
+++ b/arduino.pd
@@ -1,52 +1,52 @@
-#N canvas 365 27 652 384 10;
+#N canvas 365 27 676 408 10;
#X obj 377 9 import hardware flatspace iemlib mapping;
#X text 321 336 released under the GNU GPL;
#X obj 61 19 inlet;
#X obj 61 297 outlet;
#X obj 544 297 outlet;
-#N canvas 405 22 673 393 command 0;
+#N canvas 350 22 685 405 command 1;
#X obj 24 7 inlet;
#X obj 281 289 outlet;
#X obj 210 93 clip 0 1;
#X obj 210 114 int;
-#N canvas 729 244 495 303 digital-out 0;
+#N canvas 729 244 499 307 digital-out 0;
#X obj 26 12 inlet;
#X obj 218 219 outlet;
-#X obj 181 137 trigger bang float;
#X obj 97 172 float;
#X obj 26 31 trigger anything bang;
-#X obj 27 137 trigger float bang;
#X obj 218 171 float;
#X obj 26 77 route 0 1 2 3 4 5 6 7 8 9 10 11 12 13;
#X obj 181 115 bytemask -----;
#X obj 27 115 bytemask ---------;
#X msg 404 92 144;
-#X connect 0 0 4 0;
-#X connect 2 0 3 0;
-#X connect 2 1 6 0;
-#X connect 3 0 1 0;
-#X connect 4 0 7 0;
-#X connect 4 1 10 0;
-#X connect 5 0 3 0;
-#X connect 5 1 6 0;
-#X connect 6 0 1 0;
+#X obj 27 137 trigger bang float;
+#X obj 181 137 trigger float bang;
+#X connect 0 0 3 0;
+#X connect 2 0 1 0;
+#X connect 3 0 5 0;
+#X connect 3 1 8 0;
+#X connect 4 0 1 0;
+#X connect 5 0 7 0;
+#X connect 5 1 7 1;
+#X connect 5 2 7 2;
+#X connect 5 3 7 3;
+#X connect 5 4 7 4;
+#X connect 5 5 7 5;
+#X connect 5 6 7 6;
+#X connect 5 7 6 0;
+#X connect 5 8 6 1;
+#X connect 5 9 6 2;
+#X connect 5 10 6 3;
+#X connect 5 11 6 4;
+#X connect 5 12 6 5;
+#X connect 5 13 6 6;
+#X connect 6 0 10 0;
#X connect 7 0 9 0;
-#X connect 7 1 9 1;
-#X connect 7 2 9 2;
-#X connect 7 3 9 3;
-#X connect 7 4 9 4;
-#X connect 7 5 9 5;
-#X connect 7 6 9 6;
-#X connect 7 7 8 0;
-#X connect 7 8 8 1;
-#X connect 7 9 8 2;
-#X connect 7 10 8 3;
-#X connect 7 11 8 4;
-#X connect 7 12 8 5;
-#X connect 7 13 8 6;
-#X connect 8 0 2 0;
-#X connect 9 0 5 0;
-#X connect 10 0 1 0;
+#X connect 8 0 1 0;
+#X connect 9 0 2 0;
+#X connect 9 1 4 0;
+#X connect 10 0 2 0;
+#X connect 10 1 4 0;
#X restore 377 118 pd digital-out;
#N canvas 310 221 536 343 pinMode 0;
#X obj 190 11 inlet;
@@ -78,107 +78,79 @@
#X connect 13 0 12 0;
#X connect 13 1 1 0;
#X restore 280 93 pd pinMode;
-#X obj 139 133 + 160;
#X obj 210 135 + 150;
-#N canvas 291 228 432 364 pwm 0;
+#N canvas 300 373 368 376 pwm 0;
#X obj 44 14 inlet;
-#X msg 327 220 251;
-#X obj 114 312 outlet;
-#X obj 232 185 * 255;
-#X obj 232 164 clip 0 1;
-#X obj 232 205 int;
-#N canvas 0 22 462 312 list-rev 0;
-#X obj 92 29 inlet;
-#N canvas 0 22 533 407 drip 0;
-#X obj 64 206 list split 1;
-#X obj 64 123 until;
-#X obj 64 181 list append;
-#X obj 194 206 bang;
-#X obj 64 243 outlet;
-#X obj 64 57 inlet;
-#X text 237 44 From list-help.pd;
-#X obj 143 243 outlet;
-#X obj 64 86 t b a;
-#X connect 0 0 4 0;
-#X connect 0 1 2 1;
-#X connect 0 2 3 0;
-#X connect 0 2 7 0;
-#X connect 1 0 2 0;
-#X connect 2 0 0 0;
-#X connect 3 0 1 1;
-#X connect 5 0 8 0;
-#X connect 8 0 1 0;
-#X connect 8 1 2 1;
-#X restore 92 94 pd drip;
-#X obj 148 141 t l;
-#X obj 92 141 list;
-#X obj 136 207 list;
-#X obj 136 259 outlet;
-#X text 174 95 drip list;
-#X text 174 210 intermediate store \, bang'd on list end.;
-#X text 178 140 repack in reverse order;
-#X obj 92 54 t a b b;
-#X connect 0 0 9 0;
-#X connect 1 0 3 0;
-#X connect 1 1 4 0;
-#X connect 2 0 3 1;
-#X connect 3 0 2 0;
-#X connect 3 0 4 1;
-#X connect 4 0 5 0;
-#X connect 9 0 1 0;
-#X connect 9 1 3 1;
-#X connect 9 2 4 1;
-#X restore 44 54 pd list-rev;
-#X obj 44 113 route off;
-#X msg 74 170 250;
-#X obj 44 83 list trim;
-#X text 361 222 PWM on;
-#X obj 44 145 t f b;
-#X text 105 170 PWM off;
-#X obj 232 141 unpack f f;
-#X obj 297 195 t f b;
-#X connect 0 0 6 0;
-#X connect 1 0 2 0;
-#X connect 3 0 5 0;
-#X connect 4 0 3 0;
-#X connect 5 0 2 0;
-#X connect 6 0 9 0;
-#X connect 7 0 11 0;
-#X connect 7 1 13 0;
-#X connect 8 0 2 0;
-#X connect 9 0 7 0;
-#X connect 11 0 2 0;
-#X connect 11 1 8 0;
-#X connect 13 0 4 0;
-#X connect 13 1 14 0;
-#X connect 14 0 2 0;
-#X connect 14 1 1 0;
+#X obj 44 312 outlet;
+#X obj 44 79 unpack float float;
+#X obj 44 124 + 224;
+#X text 78 125 0xE0;
+#X msg 44 249 \$1 \, \$2 \, \$3;
+#X obj 44 212 pack float float float;
+#X obj 149 126 * 255;
+#X obj 173 165 >> 7;
+#X obj 108 165 & 127;
+#X connect 0 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 1 7 0;
+#X connect 3 0 6 0;
+#X connect 5 0 1 0;
+#X connect 6 0 5 0;
+#X connect 7 0 8 0;
+#X connect 7 0 9 0;
+#X connect 8 0 6 2;
+#X connect 9 0 6 1;
#X restore 24 94 pd pwm;
#X msg 359 93 info;
#X obj 412 91 route digital version;
#X obj 24 51 route pwm analog analogIns digitalIns pinMode info;
-#X obj 139 93 clip 0 9;
#X msg 473 118 249;
-#X connect 0 0 11 0;
+#N canvas 0 22 454 304 analogIns 0;
+#X obj 64 7 inlet;
+#X obj 69 263 outlet;
+#X obj 64 65 unpack float float;
+#X obj 69 175 pack float float;
+#X msg 69 201 \$1 \, \$2;
+#X obj 169 95 select 0;
+#X obj 214 118 bang;
+#X msg 214 140 1;
+#X msg 169 117 0;
+#X obj 64 124 + 192;
+#X obj 64 95 moses 16;
+#X text 100 123 0xC0;
+#X connect 0 0 2 0;
+#X connect 2 0 10 0;
+#X connect 2 1 5 0;
+#X connect 3 0 4 0;
+#X connect 4 0 1 0;
+#X connect 5 0 8 0;
+#X connect 5 1 6 0;
+#X connect 6 0 7 0;
+#X connect 7 0 3 1;
+#X connect 8 0 3 1;
+#X connect 9 0 3 0;
+#X connect 10 0 9 0;
+#X restore 106 94 pd analogIns;
+#X connect 0 0 10 0;
#X connect 2 0 3 0;
-#X connect 3 0 7 0;
+#X connect 3 0 6 0;
#X connect 4 0 1 0;
#X connect 5 0 1 0;
#X connect 6 0 1 0;
#X connect 7 0 1 0;
#X connect 8 0 1 0;
-#X connect 9 0 1 0;
-#X connect 10 0 4 0;
-#X connect 10 1 13 0;
-#X connect 10 2 1 0;
-#X connect 11 0 8 0;
-#X connect 11 2 12 0;
-#X connect 11 3 2 0;
-#X connect 11 4 5 0;
-#X connect 11 5 9 0;
-#X connect 11 6 10 0;
-#X connect 12 0 6 0;
-#X connect 13 0 1 0;
+#X connect 9 0 4 0;
+#X connect 9 1 11 0;
+#X connect 9 2 1 0;
+#X connect 10 0 7 0;
+#X connect 10 1 7 0;
+#X connect 10 2 12 0;
+#X connect 10 3 2 0;
+#X connect 10 4 5 0;
+#X connect 10 5 8 0;
+#X connect 10 6 9 0;
+#X connect 11 0 1 0;
+#X connect 12 0 1 0;
#X restore 61 52 pd command processing;
#X obj 319 19 inlet;
#X text 306 1 raw input;
@@ -191,7 +163,7 @@
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X restore 410 112 pd report object version;
-#N canvas 0 22 466 316 report 0;
+#N canvas 0 22 474 324 report 0;
#X obj 66 7 inlet;
#X obj 66 36 route open;
#X obj 66 60 select 1;
@@ -203,7 +175,7 @@
#X connect 4 0 3 0;
#X restore 231 113 pd report firmware version;
#X text 335 299 DEBUG/RAW data (this will change);
-#N canvas 72 70 443 397 make 0;
+#N canvas 225 71 451 405 make 0;
#X obj 79 6 inlet;
#X obj 184 337 outlet;
#X obj 79 72 moses 128;
@@ -258,10 +230,10 @@
#X obj 117 188 - 1;
#X obj 79 128 trigger bang float;
#X text 140 72 only process command bytes;
-#N canvas 0 22 470 320 convert 0;
+#N canvas 0 22 474 324 convert 0;
#X obj 142 218 outlet;
#X obj 257 218 print UNKNOWN_INPUT_COMMAND;
-#N canvas 123 202 626 303 digital 0;
+#N canvas 123 202 630 307 digital 0;
#X obj 163 16 inlet;
#X obj 252 255 outlet;
#X obj 163 42 unpack float float;
@@ -364,17 +336,19 @@
#X connect 9 1 5 0;
#X connect 11 0 1 0;
#X restore 62 199 pd make lists;
-#N canvas 0 22 501 245 check 0;
+#N canvas 0 22 521 265 check 0;
#X obj 47 62 inlet;
#X obj 47 88 route version;
-#X obj 47 109 unpack float float;
-#X obj 92 153 print [arduino]_WARNING_INCOMPATIBLE_FIRMWARE_VERSION
+#X obj 87 119 unpack float float;
+#X obj 132 163 print [arduino]_WARNING_INCOMPATIBLE_FIRMWARE_VERSION
;
-#X obj 47 131 select 1;
-#X text 102 132 <-- this sets the firmware version this is compatible
+#X obj 87 141 select 1;
+#X text 142 142 <-- this sets the firmware version this is compatible
with;
+#X obj 47 192 print Arduino/Firmata_version;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
+#X connect 1 0 6 0;
#X connect 2 0 4 0;
#X connect 4 1 3 0;
#X restore 92 242 pd check version;