aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-09-03 22:38:40 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2006-09-03 22:38:40 +0000
commitfc002eadfd81a8556b2e20681ed4e3a6d9e1f754 (patch)
treeed0fc2c03e2fc5364daa241344984b9c8bd3f3ba
parent851777a865322fae352938197015e70382a79580 (diff)
arduino-test.pd
svn path=/trunk/externals/hardware/arduino/; revision=5859
-rw-r--r--Pd_firmware/Pd_firmware.pde16
-rw-r--r--arduino-test.pd452
-rw-r--r--arduino.pd58
3 files changed, 493 insertions, 33 deletions
diff --git a/Pd_firmware/Pd_firmware.pde b/Pd_firmware/Pd_firmware.pde
index b76f749..1d64867 100644
--- a/Pd_firmware/Pd_firmware.pde
+++ b/Pd_firmware/Pd_firmware.pde
@@ -36,7 +36,8 @@
/*
* TODO: get digitalInput working
- * TODO: add pulseIn functionality
+ * TODO: add pulseIn/pulseOut functionality
+ * TODO: save settings to EEPROM
* TODO: add software PWM for servos, etc (servo.h or pulse.h)
* TODO: redesign protocol to accomodate boards with more I/Os
* TODO: add cycle markers to mark start of analog, digital, pulseIn, and PWM
@@ -112,7 +113,7 @@
/* two byte PWM data format
* ----------------------
- * 0 get ready for digital input bytes (ENABLE_SOFTWARE_PWM/ENABLE_PWM)
+ * 0 get ready for digital input bytes (ENABLE_PWM)
* 1 pin #
* 2 duty cycle expressed as 1 byte (255 = 100%)
*/
@@ -217,18 +218,12 @@ void setPinMode(int pin, int mode) {
pwmStatus = pwmStatus &~ (1 << pin);
pinMode(pin,OUTPUT);
}
+ // this will apply to all digital pins once softPWM is implemented
else if( (mode == PWM) && (pin >= 9) && (pin <= 11) ) {
digitalPinStatus = digitalPinStatus | (1 << pin);
pwmStatus = pwmStatus | (1 << pin);
- softPwmStatus = softPwmStatus &~ (1 << pin);
pinMode(pin,OUTPUT);
}
- else if(mode == SOFTPWM) {
- digitalPinStatus = digitalPinStatus | (1 << pin);
- pwmStatus = pwmStatus &~ (1 << pin);
- softPwmStatus = softPwmStatus | (1 << pin);
- pinMode(pin,OUTPUT);
- }
}
void setSoftPwm (int pin, byte pulsePeriod) {
@@ -293,7 +288,7 @@ void processInput(byte inputData) {
case DISABLE_PWM:
setPinMode(storedInputData[0],INPUT);
break;
- case ENABLE_SOFTWARE_PWM:
+/* case ENABLE_SOFTWARE_PWM:
setPinMode(storedInputData[1],SOFTPWM);
setSoftPwm(storedInputData[1], storedInputData[0]);
break;
@@ -303,6 +298,7 @@ void processInput(byte inputData) {
case SET_SOFTWARE_PWM_FREQ:
setSoftPwmFreq(storedInputData[0]);
break;
+ */
}
executeMultiByteCommand = 0;
}
diff --git a/arduino-test.pd b/arduino-test.pd
new file mode 100644
index 0000000..124311c
--- /dev/null
+++ b/arduino-test.pd
@@ -0,0 +1,452 @@
+#N canvas 264 99 695 570 10;
+#X msg 166 173 open 3;
+#N canvas 627 365 360 384 serin 0;
+#X obj 180 61 cnv 15 15 15 empty \$0-number-canvas 3 4 8 0 14 -233017
+-1 0;
+#X obj 200 225 s \$0-number-canvas;
+#X obj 60 61 hradio 15 1 1 8 empty empty empty 0 -6 0 8 -225271 -1
+-1 3;
+#X obj 60 13 inlet;
+#X msg 200 202 label \$1;
+#X obj 200 180 makefilename %d;
+#X obj 59 108 int;
+#X msg 59 206 open \$1;
+#X obj 59 337 outlet;
+#X msg 201 306 set \$1 \$2;
+#X obj 59 266 trigger bang anything;
+#X obj 201 286 list;
+#X connect 2 0 6 0;
+#X connect 3 0 2 0;
+#X connect 4 0 1 0;
+#X connect 5 0 4 0;
+#X connect 6 0 5 0;
+#X connect 6 0 7 0;
+#X connect 7 0 10 0;
+#X connect 9 0 8 0;
+#X connect 10 0 8 0;
+#X connect 10 1 11 0;
+#X connect 11 0 9 0;
+#X coords 0 -1 1 1 136 17 1 60 60;
+#X restore 166 150 pd serin;
+#X text 163 132 serial port #;
+#X text 424 528 released under the GNU GPL;
+#X text 7 526 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
+;
+#X msg 226 173 close;
+#X obj 63 497 print --------------------;
+#X obj 434 321 tgl 15 0 empty empty changes 0 -6 0 8 -262144 -1 -1
+0 1;
+#X obj 353 61 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -262131 -1
+-1 13;
+#X obj 330 62 tgl 15 0 empty empty empty 0 -6 0 8 -262131 -1 -1 0 1
+;
+#X obj 373 321 tgl 15 0 empty empty all 0 -6 0 8 -262144 -1 -1 0 1
+;
+#N canvas 514 440 628 350 decode 0;
+#X obj 241 26 inlet;
+#X obj 545 189 & 1;
+#X obj 511 189 & 2;
+#X obj 477 189 & 4;
+#X obj 545 213 tgl 15 0 empty empty 0 4 25 1 12 -262144 -1 -1 0 1;
+#X obj 511 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+2;
+#X obj 477 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+4;
+#X obj 433 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+8;
+#X obj 389 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+16;
+#X obj 314 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+64;
+#X obj 277 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+128;
+#X obj 195 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+512;
+#X obj 151 213 tgl 15 0 empty empty 10 -1 25 1 12 -262144 -1 -1 0 1024
+;
+#X obj 107 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+2048;
+#X obj 63 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 4096
+;
+#X obj 19 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 8192
+;
+#X obj 433 189 & 8;
+#X obj 389 189 & 16;
+#X obj 351 189 & 32;
+#X obj 314 189 & 64;
+#X obj 277 189 & 128;
+#X obj 236 189 & 256;
+#X obj 195 189 & 512;
+#X obj 151 189 & 1024;
+#X obj 107 189 & 2048;
+#X obj 63 189 & 4096;
+#X obj 19 189 & 8192;
+#X obj 261 273 outlet;
+#X floatatom 296 46 5 0 0 0 - - -;
+#X obj 236 213 tgl 15 0 empty empty 8 -1 25 1 12 -262144 -1 -1 0 256
+;
+#X obj 351 213 tgl 15 0 empty empty 5 -1 25 1 12 -262144 -1 -1 0 32
+;
+#X connect 0 0 1 0;
+#X connect 0 0 2 0;
+#X connect 0 0 3 0;
+#X connect 0 0 16 0;
+#X connect 0 0 17 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 28 0;
+#X connect 1 0 4 0;
+#X connect 2 0 5 0;
+#X connect 3 0 6 0;
+#X connect 16 0 7 0;
+#X connect 17 0 8 0;
+#X connect 18 0 30 0;
+#X connect 19 0 9 0;
+#X connect 20 0 10 0;
+#X connect 21 0 29 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 restore 473 507 pd decode buttons;
+#X obj 93 89 hsl 150 17 0 1 0 0 empty empty PWM_control_(0-1) -2 -6
+1 10 -225271 -1 -1 1700 0;
+#X msg 64 472 bang;
+#X text 461 47 7;
+#X text 355 47 0;
+#X text 502 47 10;
+#X obj 21 355 spigot 0;
+#X obj 64 326 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0 1
+;
+#X obj 21 377 route analog0 analog1 analog2 analog3 analog4 analog5
+;
+#X obj 435 422 route digital;
+#X obj 521 442 print GARBAGE;
+#X floatatom 430 507 6 0 0 0 - - -;
+#X text 329 127 how many analogIns to enable:;
+#X obj 330 188 tgl 15 1 empty empty empty 0 -6 0 8 -257472 -1 -1 1
+1;
+#X text 353 187 enable/disable digitalIns;
+#X msg 330 206 digitalIns \$1;
+#X msg 330 164 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 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 restore 330 144 pd serin;
+#X text 546 47 13;
+#X text 328 33 turn on output mode for each pin (off = input);
+#X obj 367 481 spigot;
+#X obj 400 463 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#X obj 367 502 print;
+#N canvas 0 22 269 256 speed 0;
+#X obj 21 41 inlet;
+#X obj 21 62 maxlib/speedlim 100;
+#X obj 21 84 outlet;
+#X obj 82 125 inlet;
+#X obj 82 146 maxlib/speedlim 100;
+#X obj 82 168 outlet;
+#X obj 92 135 inlet;
+#X obj 92 156 maxlib/speedlim 100;
+#X obj 92 178 outlet;
+#X obj 102 145 inlet;
+#X obj 102 166 maxlib/speedlim 100;
+#X obj 102 188 outlet;
+#X obj 112 155 inlet;
+#X obj 112 176 maxlib/speedlim 100;
+#X obj 112 198 outlet;
+#X obj 122 165 inlet;
+#X obj 122 186 maxlib/speedlim 100;
+#X obj 122 208 outlet;
+#X obj 132 175 inlet;
+#X obj 132 196 maxlib/speedlim 100;
+#X obj 132 218 outlet;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 3 0 4 0;
+#X connect 4 0 5 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 9 0 10 0;
+#X connect 10 0 11 0;
+#X connect 12 0 13 0;
+#X connect 13 0 14 0;
+#X connect 15 0 16 0;
+#X connect 16 0 17 0;
+#X connect 18 0 19 0;
+#X connect 19 0 20 0;
+#X restore 21 399 pd speed limiting for displaying values with pegging
+the CPU;
+#N canvas 77 268 462 312 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;
+#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 3 0 4 0;
+#X connect 4 0 9 1;
+#X connect 4 1 9 0;
+#X connect 6 0 5 0;
+#X connect 7 0 12 0;
+#X connect 8 0 6 0;
+#X connect 9 0 6 1;
+#X connect 9 0 11 0;
+#X connect 10 0 8 0;
+#X connect 11 0 10 0;
+#X restore 313 339 pd debugging stuff;
+#X text 351 235 use raw data to save settings more compactly;
+#X floatatom 21 424 5 0 0 3 analog0 - -;
+#X floatatom 90 424 5 0 0 3 analog1 - -;
+#X floatatom 159 424 5 0 0 3 analog2 - -;
+#X floatatom 228 424 5 0 0 3 analog3 - -;
+#X floatatom 297 424 5 0 0 3 analog4 - -;
+#X floatatom 366 424 5 0 0 3 analog5 - -;
+#X text 415 47 4;
+#X text 384 47 2;
+#X text 429 47 5;
+#X text 444 47 6;
+#X text 400 47 3;
+#X msg 330 103 outputMode 13 0;
+#N canvas 304 39 554 377 sending 0;
+#X obj 167 325 outlet;
+#X obj 49 64 tgl 15 0 empty empty 0 4 -6 1 12 -233017 -1 -1 0 1;
+#X obj 66 64 tgl 15 0 empty empty 1 4 -6 1 12 -233017 -1 -1 0 1;
+#X obj 83 64 tgl 15 0 empty empty 2 4 -6 1 12 -233017 -1 -1 0 1;
+#X obj 100 64 tgl 15 0 empty empty 3 4 -6 1 12 -233017 -1 -1 0 1;
+#X obj 117 64 tgl 15 0 empty empty 4 4 -6 1 12 -233017 -1 -1 0 1;
+#X obj 134 64 tgl 15 0 empty empty 5 4 -6 1 12 -233017 -1 -1 0 1;
+#X obj 151 64 tgl 15 0 empty empty 6 4 -6 1 12 -233017 -1 -1 0 1;
+#X text 60 11 The 8th bit is not used in the bitmask \, there are 7
+bits of digital output values per byte.;
+#X obj 168 64 tgl 15 0 empty empty 7 4 -6 1 12 -233017 -1 -1 0 1;
+#X obj 185 64 tgl 15 0 empty empty 8 4 -6 1 12 -233017 -1 -1 0 1;
+#X obj 202 64 tgl 15 0 empty empty 9 4 -6 1 12 -233017 -1 -1 0 1;
+#X obj 219 64 tgl 15 0 empty empty 10 0 -6 1 12 -233017 -1 -1 0 1;
+#X obj 236 64 tgl 15 0 empty empty 11 0 -6 1 12 -233017 -1 -1 0 1;
+#X obj 253 64 tgl 15 0 empty empty 12 0 -6 1 12 -233017 -1 -1 0 1;
+#X obj 270 64 tgl 15 0 empty empty 13 0 -6 1 12 -233017 -1 -1 0 1;
+#X obj 167 140 trigger bang float;
+#X obj 167 105 mapping/bytemask;
+#X obj 48 105 mapping/bytemask;
+#X obj 380 175 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 16383
+16383;
+#X obj 380 138 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+16383;
+#X obj 379 156 metro 100;
+#X obj 167 200 +;
+#X obj 167 163 float;
+#X obj 288 161 << 7;
+#X text 251 205 this will flash all pins set to output;
+#X obj 380 45 inlet;
+#X connect 1 0 18 0;
+#X connect 2 0 18 1;
+#X connect 3 0 18 2;
+#X connect 4 0 18 3;
+#X connect 5 0 18 4;
+#X connect 6 0 18 5;
+#X connect 7 0 18 6;
+#X connect 9 0 17 0;
+#X connect 10 0 17 1;
+#X connect 11 0 17 2;
+#X connect 12 0 17 3;
+#X connect 13 0 17 4;
+#X connect 14 0 17 5;
+#X connect 15 0 17 6;
+#X connect 16 0 23 0;
+#X connect 16 1 24 0;
+#X connect 17 0 16 0;
+#X connect 18 0 23 0;
+#X connect 19 0 0 0;
+#X connect 20 0 21 0;
+#X connect 21 0 19 0;
+#X connect 22 0 0 0;
+#X connect 23 0 22 0;
+#X connect 24 0 22 1;
+#X connect 26 0 20 0;
+#X restore 20 249 pd sending digital outs;
+#X msg 398 251 251 \, 9 \, 20 \, 142 \, 213;
+#X text 325 292 <- argument sets port #;
+#X msg 57 89 off;
+#X text 475 47 8;
+#X text 492 47 9;
+#X text 516 47 11;
+#X text 531 47 12;
+#X text 370 47 1;
+#X obj 35 61 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124 -1
+-1 5;
+#X text 143 47 7;
+#X text 37 47 0;
+#X text 184 47 10;
+#X text 230 47 13;
+#X text 97 47 4;
+#X text 66 47 2;
+#X text 111 47 5;
+#X text 126 47 6;
+#X text 82 47 3;
+#X text 157 47 8;
+#X text 174 47 9;
+#X text 200 47 11;
+#X text 215 47 12;
+#X text 52 47 1;
+#N canvas 66 58 415 495 pwm 0;
+#X obj 38 10 inlet;
+#X obj 131 10 inlet;
+#X msg 37 308 pwm \$1 \$2;
+#X obj 38 259 pack float float;
+#X obj 192 113 route float symbol;
+#X obj 188 259 pack float symbol;
+#X text 78 11 pin#;
+#X text 179 10 PWM value or "off";
+#X obj 39 217 cyclone/gate 2;
+#X msg 191 153 1;
+#X msg 252 153 2;
+#X obj 131 34 list;
+#X obj 131 113 float;
+#X obj 131 67 trigger bang anything;
+#X obj 37 427 outlet;
+#X obj 37 356 trigger bang anything;
+#X obj 179 376 list;
+#X msg 179 396 set \$1 \$2 \$3;
+#X connect 0 0 12 0;
+#X connect 1 0 11 0;
+#X connect 2 0 15 0;
+#X connect 3 0 2 0;
+#X connect 4 0 9 0;
+#X connect 4 0 3 1;
+#X connect 4 1 10 0;
+#X connect 4 1 5 1;
+#X connect 5 0 2 0;
+#X connect 8 0 3 0;
+#X connect 8 1 5 0;
+#X connect 9 0 8 0;
+#X connect 10 0 8 0;
+#X connect 11 0 13 0;
+#X connect 12 0 8 1;
+#X connect 13 0 12 0;
+#X connect 13 1 4 0;
+#X connect 15 0 14 0;
+#X connect 15 1 16 0;
+#X connect 16 0 17 0;
+#X connect 17 0 14 0;
+#X restore 36 115 pd pwm;
+#X msg 36 135 pwm 10 0.436242;
+#N canvas 45 415 403 327 pin 0;
+#X obj 42 19 inlet;
+#X obj 218 20 inlet;
+#X obj 64 154 pack float float;
+#X obj 218 92 trigger bang float;
+#X text 82 19 input(0)/output(1);
+#X msg 64 180 outputMode \$2 \$1;
+#X obj 64 277 outlet;
+#X obj 64 206 trigger bang anything;
+#X obj 206 226 list;
+#X msg 206 246 set \$1 \$2 \$3;
+#X connect 0 0 2 0;
+#X connect 1 0 3 0;
+#X connect 2 0 5 0;
+#X connect 3 0 2 0;
+#X connect 3 1 2 1;
+#X connect 5 0 7 0;
+#X connect 7 0 6 0;
+#X connect 7 1 8 0;
+#X connect 8 0 9 0;
+#X connect 9 0 6 0;
+#X restore 330 82 pd pin mode;
+#X obj 255 293 arduino 1;
+#X text 17 7 The [arduino] object works with the Firmata firmware for
+Arduino.;
+#X msg 195 196 info;
+#X obj 20 230 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0 16383
+;
+#X text 38 229 pulse all outputs;
+#X connect 0 0 76 0;
+#X connect 1 0 0 0;
+#X connect 5 0 76 0;
+#X connect 7 0 35 2;
+#X connect 8 0 75 1;
+#X connect 9 0 75 0;
+#X connect 10 0 35 1;
+#X connect 12 0 73 1;
+#X connect 13 0 6 0;
+#X connect 17 0 19 0;
+#X connect 18 0 17 1;
+#X connect 19 0 34 0;
+#X connect 19 1 34 1;
+#X connect 19 2 34 2;
+#X connect 19 3 34 3;
+#X connect 19 4 34 4;
+#X connect 19 5 34 5;
+#X connect 19 6 34 6;
+#X connect 20 0 11 0;
+#X connect 20 0 22 0;
+#X connect 20 0 31 0;
+#X connect 20 1 21 0;
+#X connect 24 0 26 0;
+#X connect 26 0 76 0;
+#X connect 27 0 76 0;
+#X connect 28 0 27 0;
+#X connect 31 0 33 0;
+#X connect 32 0 31 1;
+#X connect 34 0 37 0;
+#X connect 34 1 38 0;
+#X connect 34 2 39 0;
+#X connect 34 3 40 0;
+#X connect 34 4 41 0;
+#X connect 34 5 42 0;
+#X connect 34 6 20 0;
+#X connect 48 0 76 0;
+#X connect 49 0 76 0;
+#X connect 50 0 76 1;
+#X connect 52 0 73 1;
+#X connect 58 0 73 0;
+#X connect 73 0 74 0;
+#X connect 74 0 76 0;
+#X connect 75 0 48 0;
+#X connect 76 0 17 0;
+#X connect 76 1 35 0;
+#X connect 78 0 76 0;
+#X connect 79 0 49 0;
diff --git a/arduino.pd b/arduino.pd
index 6384c41..b44a767 100644
--- a/arduino.pd
+++ b/arduino.pd
@@ -1,4 +1,4 @@
-#N canvas 527 196 664 533 10;
+#N canvas 404 56 676 545 10;
#X obj 504 -5 import flatspace;
#X text 414 457 released under the GNU GPL;
#X text 9 457 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
@@ -57,7 +57,7 @@
#X obj 11 -9 inlet;
#X obj 126 425 outlet;
#X obj 494 241 outlet;
-#N canvas 678 51 534 329 command 0;
+#N canvas 415 22 542 337 command 0;
#X obj 29 8 inlet;
#X obj 148 269 outlet;
#X obj 100 94 clip 0 6;
@@ -84,25 +84,39 @@
#X connect 7 0 4 0;
#X connect 8 0 1 0;
#X restore 403 93 pd digital-out;
-#N canvas 133 22 478 328 outputMode 0;
-#X obj 81 11 inlet;
-#X obj 105 275 outlet;
-#X obj 81 70 unpack float float;
-#X obj 105 176 +;
-#X obj 105 197 + 130;
-#X obj 178 126 * 70;
-#X text 152 198 input commands = 130-143;
-#X text 216 127 output commands = 200-213;
-#X connect 0 0 2 0;
+#N canvas 90 168 520 327 outputMode 0;
+#X obj 60 11 inlet;
+#X obj 175 275 outlet;
+#X obj 175 87 unpack float float;
+#X obj 175 176 +;
+#X obj 175 197 + 130;
+#X obj 296 126 * 70;
+#X text 222 198 input commands = 130-143;
+#X text 334 127 output commands = 200-213;
+#X msg 61 229 151;
+#X obj 60 48 trigger bang anything;
+#X obj 61 182 float;
+#X text 142 86 pin#;
+#X text 312 87 mode;
+#X text 89 229 send 151/ENABLE_DIGITAL_INPUT whenever a pin is set
+to input;
+#X obj 61 202 select 0;
+#X connect 0 0 9 0;
#X connect 2 0 3 0;
#X connect 2 1 5 0;
+#X connect 2 1 10 1;
#X connect 3 0 4 0;
#X connect 4 0 1 0;
#X connect 5 0 3 1;
+#X connect 8 0 1 0;
+#X connect 9 0 10 0;
+#X connect 9 1 2 0;
+#X connect 10 0 14 0;
+#X connect 14 0 8 0;
#X restore 241 94 pd outputMode;
#X obj 100 135 + 160;
#X obj 171 137 + 150;
-#N canvas 345 422 474 324 pwm 0;
+#N canvas 345 422 478 328 pwm 0;
#X obj 66 8 inlet;
#X obj 102 276 outlet;
#X obj 238 139 * 255;
@@ -137,10 +151,9 @@
#X connect 14 0 7 0;
#X connect 14 0 8 1;
#X restore 30 94 pd pwm;
-#X obj 22 233 print PWM;
#X obj 46 52 route pwm analogIns digitalIns outputMode info;
#X msg 355 94 info;
-#X connect 0 0 11 0;
+#X connect 0 0 10 0;
#X connect 2 0 7 0;
#X connect 3 0 4 0;
#X connect 4 0 8 0;
@@ -149,14 +162,13 @@
#X connect 7 0 1 0;
#X connect 8 0 1 0;
#X connect 9 0 1 0;
-#X connect 9 0 10 0;
-#X connect 11 0 9 0;
-#X connect 11 1 2 0;
-#X connect 11 2 3 0;
-#X connect 11 3 6 0;
-#X connect 11 4 12 0;
-#X connect 11 5 5 0;
-#X connect 12 0 1 0;
+#X connect 10 0 9 0;
+#X connect 10 1 2 0;
+#X connect 10 2 3 0;
+#X connect 10 3 6 0;
+#X connect 10 4 11 0;
+#X connect 10 5 5 0;
+#X connect 11 0 1 0;
#X restore 11 22 pd command processing;
#X obj 66 132 moses 128;
#X msg 27 346 symbol digital;