diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2008-11-25 00:07:24 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2008-11-25 00:07:24 +0000 |
commit | 6e9247a0756a52691b254ba811d80f37e36c8303 (patch) | |
tree | d7e488b681e851d7eaf845b29efa0eb8e90cfbb1 | |
parent | 5741e386459656d166885555a7b7db465d357aca (diff) |
Fixed bug reported by Derek Holzer here:
http://lists.puredata.info/pipermail/pd-list/2008-10/065393.html
Basically, it needs to keep track of the state of all of the pins on the
arduino, it was only keeping track per-port, and then using the state of one
port when outputting another.
svn path=/trunk/externals/hardware/arduino/; revision=10378
-rw-r--r-- | arduino.pd | 194 |
1 files changed, 126 insertions, 68 deletions
@@ -1,51 +1,73 @@ -#N canvas 91 22 585 366 10; +#N canvas 486 297 585 366 10; #X obj 32 26 inlet; #X obj 32 304 outlet; #X obj 515 304 outlet; -#N canvas 441 370 712 343 command 0; +#N canvas 100 292 813 345 command 1; #X obj 24 7 inlet; #X obj 281 289 outlet; -#N canvas 568 603 569 343 digital-out 0; +#N canvas 176 407 597 479 digital-out 0; #X obj 3 15 inlet; -#X obj 72 296 outlet; -#X obj 99 196 mapping/bytemask; -#X msg 272 128 \$1; -#X text 301 127 add channel to command; -#X text 310 171 0x90; -#X obj 272 172 + 144; -#X obj 272 150 div 8; -#X obj 3 55 trigger bang bang anything anything; -#X obj 84 137 pack 0 0; -#X obj 84 96 unpack 0 0; -#X obj 84 117 mod 8; -#X obj 230 245 print [arduino] WARNING: extraneous digital input; -#X obj 72 221 float; -#X obj 25 221 float; -#X obj 84 158 route 7 0 1 2 3 4 5 6; -#X connect 0 0 8 0; -#X connect 2 0 13 1; -#X connect 3 0 7 0; -#X connect 6 0 1 0; -#X connect 7 0 6 0; -#X connect 8 0 14 0; -#X connect 8 1 13 0; -#X connect 8 2 10 0; -#X connect 8 3 3 0; -#X connect 9 0 15 0; -#X connect 10 0 11 0; -#X connect 10 1 9 1; -#X connect 11 0 9 0; -#X connect 13 0 1 0; -#X connect 14 0 1 0; -#X connect 15 0 14 1; -#X connect 15 1 2 0; -#X connect 15 2 2 1; -#X connect 15 3 2 2; -#X connect 15 4 2 3; -#X connect 15 5 2 4; -#X connect 15 6 2 5; -#X connect 15 7 2 6; -#X connect 15 8 12 0; +#X obj 283 440 outlet; +#X msg 372 88 \$1; +#X text 401 87 add channel to command; +#X text 410 131 0x90; +#X obj 372 132 + 144; +#X obj 372 110 div 8; +#X obj 211 391 float; +#X obj 144 391 float; +#X obj 408 16 inlet; +#X text 453 17 state from port-out; +#X msg 156 84 \$2; +#X obj 235 143 <<; +#X msg 235 122 1 \$1; +#X obj 283 242 * 8; +#X obj 171 371 >> 7; +#X obj 238 371 & 127; +#X obj 248 314 &; +#X msg 289 267 255 \$1; +#X obj 289 288 <<; +#X obj 4 55 trigger bang bang bang anything anything anything; +#X obj 193 255 float; +#X obj 254 338 >>; +#X obj 222 215 |; +#X obj 218 173 float; +#X obj 157 172 float; +#X obj 156 115 select 0 1; +#X obj 84 215 expr ~$f1 & $f2; +#X connect 0 0 20 0; +#X connect 2 0 6 0; +#X connect 5 0 1 0; +#X connect 6 0 5 0; +#X connect 6 0 14 0; +#X connect 7 0 1 0; +#X connect 8 0 1 0; +#X connect 11 0 26 0; +#X connect 12 0 24 1; +#X connect 12 0 25 1; +#X connect 13 0 12 0; +#X connect 14 0 18 0; +#X connect 14 0 22 1; +#X connect 15 0 8 1; +#X connect 16 0 7 1; +#X connect 17 0 22 0; +#X connect 18 0 19 0; +#X connect 19 0 17 1; +#X connect 20 0 8 0; +#X connect 20 1 7 0; +#X connect 20 3 11 0; +#X connect 20 4 13 0; +#X connect 20 5 2 0; +#X connect 21 0 23 1; +#X connect 21 0 27 1; +#X connect 21 0 17 0; +#X connect 22 0 16 0; +#X connect 22 0 15 0; +#X connect 23 0 21 0; +#X connect 24 0 23 0; +#X connect 25 0 27 0; +#X connect 26 0 25 0; +#X connect 26 1 24 0; +#X connect 27 0 21 0; #X restore 326 122 pd digital-out; #N canvas 310 221 540 347 pinMode 0; #X obj 190 11 inlet; @@ -100,7 +122,7 @@ #X connect 9 0 6 1; #X restore 24 94 pd pwm; #X msg 307 94 info; -#X msg 420 136 249; +#X msg 510 136 249; #N canvas 0 22 462 312 analogIns 0; #X obj 64 7 inlet; #X obj 69 263 outlet; @@ -142,10 +164,9 @@ #X connect 5 0 3 0; #X connect 6 0 5 0; #X restore 150 94 pd digitalIns; -#X obj 361 77 route digital version firmware; -#X msg 479 136 240 \, 121 \, 247; -#X obj 420 116 bang; -#X obj 479 115 bang; +#X msg 569 136 240 \, 121 \, 247; +#X obj 510 116 bang; +#X obj 569 115 bang; #X obj 24 51 route pwm analog analogIns digitalIns pinMode info; #N canvas 624 420 451 466 sysex 0; #X obj 62 424 outlet; @@ -216,9 +237,44 @@ #X connect 16 0 2 0; #X connect 16 1 17 0; #X connect 17 0 3 1; -#X restore 572 136 pd sysex; -#X obj 572 114 route sysex string; -#X connect 0 0 13 0; +#X restore 662 136 pd sysex; +#X obj 662 114 route sysex string; +#N canvas 481 623 569 343 port-out 0; +#X obj 13 15 inlet; +#X obj 167 281 outlet; +#X msg 244 82 \$1; +#X text 273 81 add channel to command; +#X text 309 187 0x90; +#X obj 271 188 + 144; +#X obj 244 106 moses; +#X obj 13 55 trigger bang anything anything anything; +#X obj 271 126 moses 16; +#X obj 353 196 print [arduino]; +#X msg 353 174 ERROR: no such channel: \$1; +#X msg 167 82 \$2; +#X msg 90 82 \$2; +#X obj 167 106 & 127; +#X obj 90 106 & 128; +#X obj 90 131 == 128; +#X connect 0 0 7 0; +#X connect 2 0 6 0; +#X connect 5 0 1 0; +#X connect 6 0 10 0; +#X connect 6 1 8 0; +#X connect 7 1 12 0; +#X connect 7 2 11 0; +#X connect 7 3 2 0; +#X connect 8 0 5 0; +#X connect 8 1 10 0; +#X connect 10 0 9 0; +#X connect 11 0 13 0; +#X connect 12 0 14 0; +#X connect 13 0 1 0; +#X connect 14 0 15 0; +#X connect 15 0 1 0; +#X restore 425 122 pd port-out; +#X obj 361 77 route digital port version firmware; +#X connect 0 0 12 0; #X connect 2 0 1 0; #X connect 3 0 1 0; #X connect 4 0 1 0; @@ -226,24 +282,26 @@ #X connect 6 0 1 0; #X connect 7 0 1 0; #X connect 8 0 1 0; -#X connect 9 0 2 0; -#X connect 9 1 11 0; -#X connect 9 2 12 0; -#X connect 9 3 15 0; -#X connect 10 0 1 0; -#X connect 11 0 6 0; -#X connect 12 0 10 0; -#X connect 13 0 4 0; -#X connect 13 1 4 0; -#X connect 13 2 7 0; -#X connect 13 3 8 0; -#X connect 13 4 3 0; -#X connect 13 5 5 0; -#X connect 13 6 9 0; -#X connect 14 0 1 0; -#X connect 15 0 14 0; -#X connect 15 1 14 1; -#X connect 15 2 1 0; +#X connect 9 0 1 0; +#X connect 10 0 6 0; +#X connect 11 0 9 0; +#X connect 12 0 4 0; +#X connect 12 1 4 0; +#X connect 12 2 7 0; +#X connect 12 3 8 0; +#X connect 12 4 3 0; +#X connect 12 5 5 0; +#X connect 12 6 16 0; +#X connect 13 0 1 0; +#X connect 14 0 13 0; +#X connect 14 1 13 1; +#X connect 14 2 1 0; +#X connect 15 0 1 0; +#X connect 16 0 2 0; +#X connect 16 1 15 0; +#X connect 16 2 10 0; +#X connect 16 3 11 0; +#X connect 16 4 14 0; #X restore 32 59 pd command processing; #X text 28 8 processed input; #X obj 381 95 loadbang; |