Difference between revisions of "User:Hamsammich"
Hamsammich (talk | contribs) |
Hamsammich (talk | contribs) |
||
(One intermediate revision by the same user not shown) | |||
Line 22: | Line 22: | ||
________________ | ________________ | ||
+ | |||
+ | |||
+ | FINAL DOCUMENTATION: | ||
+ | |||
+ | [[Image:Truck.jpg]] | ||
+ | |||
+ | [[Image:Remote.jpg]] | ||
+ | |||
+ | [[Image:Breadboard.jpg]] | ||
+ | |||
+ | [[Image:Trans.jpg]] | ||
+ | |||
+ | [[Image:Arduino.jpg]] | ||
+ | |||
+ | [[Image:Remote2.jpg]] | ||
+ | |||
+ | [[Image:Remote3.jpg]] | ||
+ | |||
+ | [[Image:Trans2.jpg]] | ||
+ | |||
+ | [[Image:Control.jpg]] | ||
+ | |||
+ | |||
+ | Code used for Final: | ||
+ | |||
+ | #N canvas 331 48 894 684 10; | ||
+ | #X obj 313 116 cnv 15 100 22 empty empty empty 20 12 0 14 -253938 -66577 | ||
+ | 0; | ||
+ | #X obj 23 145 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577 | ||
+ | 0; | ||
+ | #X obj 155 170 cnv 15 60 22 empty empty empty 20 12 0 14 -253938 -66577 | ||
+ | 0; | ||
+ | #X msg 161 172 open 2; | ||
+ | #N canvas 128 22 525 433 serin 0; | ||
+ | #X obj 180 61 cnv 15 15 15 empty \$0-number-canvas 2 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 2; | ||
+ | #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 377 outlet; | ||
+ | #X msg 201 306 set \$1 \$2; | ||
+ | #X obj 59 266 trigger bang anything; | ||
+ | #X obj 201 286 list; | ||
+ | #X obj 383 383 outlet; | ||
+ | #X obj 384 22 netreceive 34567; | ||
+ | #X obj 477 43 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0 | ||
+ | 1; | ||
+ | #X obj 384 41 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 -1 | ||
+ | -1; | ||
+ | #X obj 187 24 delay 15000; | ||
+ | #X text 345 379 close; | ||
+ | #X text 209 4 for open/close automation in Makefile; | ||
+ | #N canvas 698 22 318 215 reset 0; | ||
+ | #X obj 65 24 inlet; | ||
+ | #X obj 66 58 bang; | ||
+ | #X obj 66 150 send ARDUINO_TEST_RESET; | ||
+ | #X msg 66 129 0; | ||
+ | #X msg 111 99 1; | ||
+ | #X obj 111 120 send ARDUINO_PINMODE_RESET; | ||
+ | #X connect 0 0 1 0; | ||
+ | #X connect 1 0 3 0; | ||
+ | #X connect 1 0 4 0; | ||
+ | #X connect 3 0 2 0; | ||
+ | #X connect 4 0 5 0; | ||
+ | #X restore 172 111 pd reset guis; | ||
+ | #X connect 2 0 6 0; | ||
+ | #X connect 2 0 19 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 connect 13 0 15 0; | ||
+ | #X connect 13 1 14 0; | ||
+ | #X connect 15 0 16 0; | ||
+ | #X connect 15 0 12 0; | ||
+ | #X connect 16 0 2 0; | ||
+ | #X coords 0 -1 1 1 136 17 1 60 60; | ||
+ | #X restore 161 149 pd serin; | ||
+ | #X text 158 131 serial port #; | ||
+ | #X msg 221 172 close; | ||
+ | #X obj 85 104 hsl 150 17 0 1 0 0 empty ARDUINO_TEST_RESET analog_output_(0-1) | ||
+ | 20 9 1 10 -225271 -1 -1 0 0; | ||
+ | #X obj 267 302 tgl 15 1 empty empty empty 0 -6 0 8 -225271 -1 -1 1 | ||
+ | 1; | ||
+ | #X msg 437 220 digitalIns 0 0; | ||
+ | #X msg 437 165 analogIns 0 0; | ||
+ | #N canvas 162 133 610 460 serin 0; | ||
+ | #X obj 59 337 outlet; | ||
+ | #X obj 59 266 trigger bang anything; | ||
+ | #X obj 201 286 list; | ||
+ | #X obj 60 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 0 5 9 1 | ||
+ | 12 -262130 -1 -1 0 1; | ||
+ | #X obj 75 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 1 5 9 1 | ||
+ | 12 -262130 -1 -1 0 1; | ||
+ | #X obj 90 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 2 5 9 1 | ||
+ | 12 -262130 -1 -1 0 1; | ||
+ | #X obj 105 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 3 5 9 | ||
+ | 1 12 -262130 -1 -1 0 1; | ||
+ | #X obj 120 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 4 5 9 | ||
+ | 1 12 -262130 -1 -1 0 1; | ||
+ | #X obj 135 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 5 5 9 | ||
+ | 1 12 -262130 -1 -1 0 1; | ||
+ | #X obj 150 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 6 5 9 | ||
+ | 1 12 -262130 -1 -1 0 1; | ||
+ | #X obj 165 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 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 437 145 pd serin; | ||
+ | #X floatatom 22 426 5 0 0 3 a0 - -; | ||
+ | #X floatatom 68 426 5 0 0 3 a1 - -; | ||
+ | #X floatatom 114 426 5 0 0 3 a2 - -; | ||
+ | #X floatatom 160 426 5 0 0 3 a3 - -; | ||
+ | #X floatatom 206 426 5 0 0 3 a4 - -; | ||
+ | #X floatatom 252 426 5 0 0 3 a5 - -; | ||
+ | #X text 290 271 <- argument sets port #; | ||
+ | #X obj 30 66 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124 -1 | ||
+ | -1 0; | ||
+ | #X text 139 52 7; | ||
+ | #X text 32 52 0; | ||
+ | #X text 180 52 10; | ||
+ | #X text 226 52 13; | ||
+ | #X text 91 52 4; | ||
+ | #X text 61 52 2; | ||
+ | #X text 107 52 5; | ||
+ | #X text 122 52 6; | ||
+ | #X text 77 52 3; | ||
+ | #X text 153 52 8; | ||
+ | #X text 170 52 9; | ||
+ | #X text 196 52 11; | ||
+ | #X text 211 52 12; | ||
+ | #X text 47 52 1; | ||
+ | #X msg 31 147 analog 0 0; | ||
+ | #X msg 319 155 info; | ||
+ | #X msg 358 155 version; | ||
+ | #X obj 220 302 spigot; | ||
+ | #X msg 319 118 pinMode 23 2; | ||
+ | #N canvas 67 22 475 478 sending 0; | ||
+ | #X obj 69 228 cnv 15 100 22 empty empty empty 20 12 0 14 -253938 -66577 | ||
+ | 0; | ||
+ | #X obj 78 434 outlet; | ||
+ | #X msg 78 231 digital 22 0; | ||
+ | #X obj 127 148 tgl 15 0 empty empty 7 4 -6 1 12 -233017 -1 -1 0 1; | ||
+ | #X obj 144 148 tgl 15 0 empty empty 8 4 -6 1 12 -233017 -1 -1 0 1; | ||
+ | #X obj 161 148 tgl 15 0 empty empty 9 4 -6 1 12 -233017 -1 -1 0 1; | ||
+ | #X obj 178 148 tgl 15 0 empty empty 10 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 195 148 tgl 15 0 empty empty 11 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 212 148 tgl 15 0 empty empty 12 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 229 148 tgl 15 0 empty empty 13 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 42 148 tgl 15 0 empty empty 2 4 -6 1 12 -233017 -1 -1 0 1; | ||
+ | #X obj 59 148 tgl 15 0 empty empty 3 4 -6 1 12 -233017 -1 -1 0 1; | ||
+ | #X obj 76 148 tgl 15 0 empty empty 4 4 -6 1 12 -233017 -1 -1 0 1; | ||
+ | #X obj 93 148 tgl 15 0 empty empty 5 4 -6 1 12 -233017 -1 -1 0 1; | ||
+ | #X obj 110 148 tgl 15 0 empty empty 6 4 -6 1 12 -233017 -1 -1 0 1; | ||
+ | #X obj 418 123 tgl 25 0 empty ARDUINO_TEST_RESET ALL 2 12 0 12 -262144 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 388 72 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 16383 | ||
+ | ; | ||
+ | #X obj 388 92 metro 100; | ||
+ | #X obj 301 9 inlet; | ||
+ | #X obj 8 148 tgl 15 0 empty empty 0 3 -6 1 12 -260818 -1 -1 0 1; | ||
+ | #X obj 25 148 tgl 15 0 empty empty 1 3 -6 1 12 -260818 -1 -1 0 1; | ||
+ | #X obj 8 148 cnv 15 15 15 empty empty Rx 1 10 0 11 -128992 -86277 0 | ||
+ | ; | ||
+ | #X obj 25 148 cnv 15 15 15 empty empty Tx 1 10 0 11 -128992 -13381 | ||
+ | 0; | ||
+ | #X obj 301 43 trigger 0 float; | ||
+ | #X obj 301 64 select 0; | ||
+ | #X msg 301 84 0; | ||
+ | #X msg 405 389 port 1 0; | ||
+ | #X msg 263 389 port 0 0; | ||
+ | #X msg 189 389 port 0 255; | ||
+ | #X msg 331 389 port 1 255; | ||
+ | #X text 95 291 or send 8-bit ports in one message:; | ||
+ | #X msg 159 338 port 1 \$1; | ||
+ | #X msg 91 338 port 0 \$1; | ||
+ | #X msg 230 338 port 2 \$1; | ||
+ | #X obj 362 297 tgl 25 0 empty ARDUINO_TEST_RESET ALL 2 12 0 12 -262144 | ||
+ | -1 -1 0 255; | ||
+ | #X obj 362 246 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 | ||
+ | 16383; | ||
+ | #X obj 362 266 metro 100; | ||
+ | #X floatatom 362 329 5 0 0 0 - - -; | ||
+ | #X obj 246 148 tgl 15 0 empty empty 14 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 263 148 tgl 15 0 empty empty 15 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 280 148 tgl 15 0 empty empty 16 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 297 148 tgl 15 0 empty empty 17 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 314 148 tgl 15 0 empty empty 18 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 331 148 tgl 15 0 empty empty 19 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 348 148 tgl 15 0 empty empty 20 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 365 148 tgl 15 0 empty empty 21 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #N canvas 314 233 1035 340 generate 0; | ||
+ | #X obj 12 24 inlet; | ||
+ | #X obj 52 24 inlet; | ||
+ | #X obj 91 24 inlet; | ||
+ | #X obj 131 24 inlet; | ||
+ | #X obj 171 24 inlet; | ||
+ | #X obj 211 24 inlet; | ||
+ | #X obj 250 24 inlet; | ||
+ | #X obj 290 24 inlet; | ||
+ | #X obj 331 23 inlet; | ||
+ | #X obj 371 23 inlet; | ||
+ | #X obj 410 23 inlet; | ||
+ | #X obj 450 23 inlet; | ||
+ | #X obj 490 23 inlet; | ||
+ | #X msg 12 66 digital 0 \$1; | ||
+ | #X msg 52 88 digital 1 \$1; | ||
+ | #X msg 91 110 digital 2 \$1; | ||
+ | #X msg 131 130 digital 3 \$1; | ||
+ | #X msg 171 62 digital 4 \$1; | ||
+ | #X msg 211 84 digital 5 \$1; | ||
+ | #X msg 250 106 digital 6 \$1; | ||
+ | #X msg 290 126 digital 7 \$1; | ||
+ | #X msg 331 58 digital 8 \$1; | ||
+ | #X msg 371 80 digital 9 \$1; | ||
+ | #X msg 410 102 digital 10 \$1; | ||
+ | #X msg 450 122 digital 11 \$1; | ||
+ | #X msg 490 50 digital 12 \$1; | ||
+ | #X obj 529 23 inlet; | ||
+ | #X msg 529 70 digital 13 \$1; | ||
+ | #X obj 513 302 outlet; | ||
+ | #X obj 513 263 trigger bang anything; | ||
+ | #X obj 513 214 list prepend set; | ||
+ | #X obj 513 238 list trim; | ||
+ | #X obj 570 23 inlet; | ||
+ | #X obj 610 23 inlet; | ||
+ | #X obj 650 23 inlet; | ||
+ | #X obj 689 23 inlet; | ||
+ | #X msg 570 102 digital 14 \$1; | ||
+ | #X msg 610 122 digital 15 \$1; | ||
+ | #X msg 650 50 digital 16 \$1; | ||
+ | #X msg 689 70 digital 17 \$1; | ||
+ | #X obj 730 23 inlet; | ||
+ | #X obj 770 23 inlet; | ||
+ | #X obj 810 23 inlet; | ||
+ | #X obj 849 23 inlet; | ||
+ | #X msg 730 102 digital 18 \$1; | ||
+ | #X msg 770 122 digital 19 \$1; | ||
+ | #X msg 810 50 digital 20 \$1; | ||
+ | #X msg 849 70 digital 21 \$1; | ||
+ | #X obj 890 23 inlet; | ||
+ | #X obj 930 23 inlet; | ||
+ | #X msg 890 102 digital 22 \$1; | ||
+ | #X msg 930 122 digital 23 \$1; | ||
+ | #X connect 0 0 13 0; | ||
+ | #X connect 1 0 14 0; | ||
+ | #X connect 2 0 15 0; | ||
+ | #X connect 3 0 16 0; | ||
+ | #X connect 4 0 17 0; | ||
+ | #X connect 5 0 18 0; | ||
+ | #X connect 6 0 19 0; | ||
+ | #X connect 7 0 20 0; | ||
+ | #X connect 8 0 21 0; | ||
+ | #X connect 9 0 22 0; | ||
+ | #X connect 10 0 23 0; | ||
+ | #X connect 11 0 24 0; | ||
+ | #X connect 12 0 25 0; | ||
+ | #X connect 13 0 30 0; | ||
+ | #X connect 14 0 30 0; | ||
+ | #X connect 15 0 30 0; | ||
+ | #X connect 16 0 30 0; | ||
+ | #X connect 17 0 30 0; | ||
+ | #X connect 18 0 30 0; | ||
+ | #X connect 19 0 30 0; | ||
+ | #X connect 20 0 30 0; | ||
+ | #X connect 21 0 30 0; | ||
+ | #X connect 22 0 30 0; | ||
+ | #X connect 23 0 30 0; | ||
+ | #X connect 24 0 30 0; | ||
+ | #X connect 25 0 30 0; | ||
+ | #X connect 26 0 27 0; | ||
+ | #X connect 27 0 30 0; | ||
+ | #X connect 29 0 28 0; | ||
+ | #X connect 29 1 28 0; | ||
+ | #X connect 30 0 31 0; | ||
+ | #X connect 31 0 29 0; | ||
+ | #X connect 32 0 36 0; | ||
+ | #X connect 33 0 37 0; | ||
+ | #X connect 34 0 38 0; | ||
+ | #X connect 35 0 39 0; | ||
+ | #X connect 36 0 30 0; | ||
+ | #X connect 37 0 30 0; | ||
+ | #X connect 38 0 30 0; | ||
+ | #X connect 39 0 30 0; | ||
+ | #X connect 40 0 44 0; | ||
+ | #X connect 41 0 45 0; | ||
+ | #X connect 42 0 46 0; | ||
+ | #X connect 43 0 47 0; | ||
+ | #X connect 44 0 30 0; | ||
+ | #X connect 45 0 30 0; | ||
+ | #X connect 46 0 30 0; | ||
+ | #X connect 47 0 30 0; | ||
+ | #X connect 48 0 50 0; | ||
+ | #X connect 49 0 51 0; | ||
+ | #X connect 50 0 30 0; | ||
+ | #X connect 51 0 30 0; | ||
+ | #X restore 78 201 pd generate digital out messages ------------------ | ||
+ | ; | ||
+ | #X obj 382 148 tgl 15 0 empty empty 22 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X obj 399 148 tgl 15 0 empty empty 23 0 -6 1 12 -233017 -1 -1 0 1 | ||
+ | ; | ||
+ | #X connect 2 0 1 0; | ||
+ | #X connect 3 0 46 7; | ||
+ | #X connect 4 0 46 8; | ||
+ | #X connect 5 0 46 9; | ||
+ | #X connect 6 0 46 10; | ||
+ | #X connect 7 0 46 11; | ||
+ | #X connect 8 0 46 12; | ||
+ | #X connect 9 0 46 13; | ||
+ | #X connect 10 0 46 2; | ||
+ | #X connect 11 0 46 3; | ||
+ | #X connect 12 0 46 4; | ||
+ | #X connect 13 0 46 5; | ||
+ | #X connect 14 0 46 6; | ||
+ | #X connect 15 0 9 0; | ||
+ | #X connect 15 0 8 0; | ||
+ | #X connect 15 0 7 0; | ||
+ | #X connect 15 0 6 0; | ||
+ | #X connect 15 0 5 0; | ||
+ | #X connect 15 0 4 0; | ||
+ | #X connect 15 0 3 0; | ||
+ | #X connect 15 0 14 0; | ||
+ | #X connect 15 0 13 0; | ||
+ | #X connect 15 0 12 0; | ||
+ | #X connect 15 0 11 0; | ||
+ | #X connect 15 0 10 0; | ||
+ | #X connect 15 0 43 0; | ||
+ | #X connect 15 0 44 0; | ||
+ | #X connect 15 0 45 0; | ||
+ | #X connect 15 0 42 0; | ||
+ | #X connect 15 0 41 0; | ||
+ | #X connect 15 0 40 0; | ||
+ | #X connect 15 0 39 0; | ||
+ | #X connect 15 0 38 0; | ||
+ | #X connect 15 0 48 0; | ||
+ | #X connect 15 0 47 0; | ||
+ | #X connect 16 0 17 0; | ||
+ | #X connect 17 0 15 0; | ||
+ | #X connect 18 0 23 0; | ||
+ | #X connect 23 0 24 0; | ||
+ | #X connect 23 1 16 0; | ||
+ | #X connect 24 0 25 0; | ||
+ | #X connect 25 0 15 0; | ||
+ | #X connect 26 0 1 0; | ||
+ | #X connect 27 0 1 0; | ||
+ | #X connect 28 0 1 0; | ||
+ | #X connect 29 0 1 0; | ||
+ | #X connect 31 0 1 0; | ||
+ | #X connect 32 0 1 0; | ||
+ | #X connect 33 0 1 0; | ||
+ | #X connect 34 0 37 0; | ||
+ | #X connect 34 0 33 0; | ||
+ | #X connect 34 0 31 0; | ||
+ | #X connect 34 0 32 0; | ||
+ | #X connect 35 0 36 0; | ||
+ | #X connect 36 0 34 0; | ||
+ | #X connect 38 0 46 14; | ||
+ | #X connect 39 0 46 15; | ||
+ | #X connect 40 0 46 16; | ||
+ | #X connect 41 0 46 17; | ||
+ | #X connect 42 0 46 18; | ||
+ | #X connect 43 0 46 19; | ||
+ | #X connect 44 0 46 20; | ||
+ | #X connect 45 0 46 21; | ||
+ | #X connect 46 0 2 0; | ||
+ | #X connect 47 0 46 22; | ||
+ | #X connect 48 0 46 23; | ||
+ | #X restore -40 355 pd sending digital outs; | ||
+ | #X obj -39 331 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0 | ||
+ | 16383; | ||
+ | #X text -16 329 pulse all outputs; | ||
+ | #X floatatom 298 426 5 0 0 3 a6 - -; | ||
+ | #X floatatom 344 426 5 0 0 3 a7 - -; | ||
+ | #X obj 220 324 route analog; | ||
+ | #X obj 121 369 route 0 1 2 3 4 5 6 7; | ||
+ | #N canvas 978 22 499 396 display 0; | ||
+ | #X obj 6 7 inlet; | ||
+ | #X obj 6 28 mapping/resample 100; | ||
+ | #X obj 6 50 outlet; | ||
+ | #X obj 54 50 inlet; | ||
+ | #X obj 54 71 mapping/resample 100; | ||
+ | #X obj 54 93 outlet; | ||
+ | #X obj 103 93 inlet; | ||
+ | #X obj 103 114 mapping/resample 100; | ||
+ | #X obj 103 136 outlet; | ||
+ | #X obj 151 136 inlet; | ||
+ | #X obj 151 157 mapping/resample 100; | ||
+ | #X obj 151 179 outlet; | ||
+ | #X obj 200 179 inlet; | ||
+ | #X obj 200 200 mapping/resample 100; | ||
+ | #X obj 200 222 outlet; | ||
+ | #X obj 247 222 inlet; | ||
+ | #X obj 247 243 mapping/resample 100; | ||
+ | #X obj 247 265 outlet; | ||
+ | #X obj 295 265 inlet; | ||
+ | #X obj 295 286 mapping/resample 100; | ||
+ | #X obj 295 308 outlet; | ||
+ | #X obj 345 308 inlet; | ||
+ | #X obj 345 329 mapping/resample 100; | ||
+ | #X obj 345 351 outlet; | ||
+ | #X obj 60 290 receive ARDUINO_TEST_RESET; | ||
+ | #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 connect 21 0 22 0; | ||
+ | #X connect 22 0 23 0; | ||
+ | #X connect 24 0 22 0; | ||
+ | #X connect 24 0 19 0; | ||
+ | #X connect 24 0 16 0; | ||
+ | #X connect 24 0 13 0; | ||
+ | #X connect 24 0 10 0; | ||
+ | #X connect 24 0 7 0; | ||
+ | #X connect 24 0 4 0; | ||
+ | #X connect 24 0 1 0; | ||
+ | #X restore 45 400 pd display values without pegging the CPU; | ||
+ | #X obj 397 433 route 0 1 2 3 4 5 6 7 8 9 10 11 12 13; | ||
+ | #X obj 428 455 tgl 15 0 empty ARDUINO_TEST_RESET 2 4 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 445 455 tgl 15 0 empty ARDUINO_TEST_RESET 3 4 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 462 455 tgl 15 0 empty ARDUINO_TEST_RESET 4 4 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 479 455 tgl 15 0 empty ARDUINO_TEST_RESET 5 4 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 496 455 tgl 15 0 empty ARDUINO_TEST_RESET 6 4 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 513 455 tgl 15 0 empty ARDUINO_TEST_RESET 7 4 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 530 455 tgl 15 0 empty ARDUINO_TEST_RESET 8 4 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 547 455 tgl 15 0 empty ARDUINO_TEST_RESET 9 4 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 564 455 tgl 15 0 empty ARDUINO_TEST_RESET 10 0 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 581 455 tgl 15 0 empty ARDUINO_TEST_RESET 11 0 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 598 455 tgl 15 0 empty ARDUINO_TEST_RESET 12 0 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X obj 615 455 tgl 15 0 empty ARDUINO_TEST_RESET 13 0 23 1 12 -232448 | ||
+ | -1 -1 0 1; | ||
+ | #X text 2 484 (C) Copyright 2006 Free Software Foundation; | ||
+ | #N canvas 0 22 451 224 ver 0; | ||
+ | #X obj 23 7 inlet; | ||
+ | #X obj 250 100 cnv 15 145 17 empty \$0-version_cnv empty 4 10 0 12 | ||
+ | -203904 -1 0; | ||
+ | #X obj 23 157 send \$0-version_cnv; | ||
+ | #X msg 23 132 label \$1; | ||
+ | #X obj 48 103 symbol; | ||
+ | #X obj 38 77 loadbang; | ||
+ | #X msg 96 78 bang; | ||
+ | #X obj 309 163 outlet; | ||
+ | #X obj 23 52 zexy/makesymbol Firmata-%s.%s; | ||
+ | #X obj 23 29 route version bang; | ||
+ | #X connect 0 0 9 0; | ||
+ | #X connect 3 0 2 0; | ||
+ | #X connect 4 0 3 0; | ||
+ | #X connect 5 0 4 0; | ||
+ | #X connect 6 0 4 0; | ||
+ | #X connect 8 0 3 0; | ||
+ | #X connect 9 0 8 0; | ||
+ | #X connect 9 1 7 0; | ||
+ | #X connect 9 1 6 0; | ||
+ | #X connect 9 2 7 0; | ||
+ | #X coords 0 -1 1 1 145 17 1 250 100; | ||
+ | #X restore 397 317 pd ver; | ||
+ | #X obj 414 393 unpack 0 0; | ||
+ | #X floatatom 414 413 5 0 0 0 - - -; | ||
+ | #X floatatom 471 413 5 0 0 0 - - -; | ||
+ | #X obj 394 455 tgl 15 0 empty empty 0 4 23 1 12 -232448 -1 -1 0 1; | ||
+ | #X obj 411 455 tgl 15 0 empty empty 1 4 23 1 12 -232448 -1 -1 0 1; | ||
+ | #X obj 394 455 cnv 15 15 15 empty empty Rx 1 10 0 11 -128992 -86277 | ||
+ | 0; | ||
+ | #X obj 411 455 cnv 15 15 15 empty empty Tx 1 10 0 11 -128992 -13381 | ||
+ | 0; | ||
+ | #X text 436 128 which analogIns to enable:; | ||
+ | #X obj 220 272 arduino 1; | ||
+ | #N canvas 649 518 411 212 firmware 0; | ||
+ | #X obj 123 2 inlet; | ||
+ | #X obj 250 100 cnv 15 145 17 empty \$0-firmware_cnv empty 4 10 0 12 | ||
+ | -232576 -66577 0; | ||
+ | #X msg 123 156 label \$1; | ||
+ | #X obj 148 127 symbol; | ||
+ | #X obj 138 101 loadbang; | ||
+ | #X msg 196 102 bang; | ||
+ | #X obj 123 181 send \$0-firmware_cnv; | ||
+ | #X obj 123 24 route firmware; | ||
+ | #X obj 18 181 print Firmware; | ||
+ | #X obj 123 49 list; | ||
+ | #X obj 123 80 zexy/makesymbol %s-%s.%s; | ||
+ | #X obj 18 151 list trim; | ||
+ | #X obj 204 45 route bang; | ||
+ | #X connect 0 0 7 0; | ||
+ | #X connect 2 0 6 0; | ||
+ | #X connect 3 0 2 0; | ||
+ | #X connect 4 0 3 0; | ||
+ | #X connect 5 0 3 0; | ||
+ | #X connect 7 0 9 0; | ||
+ | #X connect 7 1 12 0; | ||
+ | #X connect 9 0 10 0; | ||
+ | #X connect 10 0 2 0; | ||
+ | #X connect 10 0 11 0; | ||
+ | #X connect 11 0 8 0; | ||
+ | #X connect 12 0 5 0; | ||
+ | #X coords 0 -1 1 1 145 17 1 250 100; | ||
+ | #X restore 397 337 pd firmware; | ||
+ | #X msg 358 195 devices; | ||
+ | #X msg 358 175 firmware; | ||
+ | #N canvas 0 22 450 300 STRING 0; | ||
+ | #X obj 48 13 inlet; | ||
+ | #X obj 51 93 moocow/string2any 32 -1; | ||
+ | #X obj 51 154 print STRING; | ||
+ | #X connect 0 0 1 0; | ||
+ | #X connect 1 0 2 0; | ||
+ | #X restore 482 393 pd STRING; | ||
+ | #N canvas 205 22 593 390 strings 0; | ||
+ | #X obj -178 287 outlet; | ||
+ | #X obj -142 101 moocow/any2string; | ||
+ | #X symbolatom -92 48 10 0 0 0 - - -; | ||
+ | #X obj -119 179 pddp/print; | ||
+ | #X obj -92 68 list trim; | ||
+ | #X msg -175 39 test; | ||
+ | #X msg -139 40 TEST; | ||
+ | #X obj -142 130 cyclone/prepend string; | ||
+ | #X obj -313 102 moocow/any2string; | ||
+ | #X symbolatom -263 49 10 0 0 0 - - -; | ||
+ | #X obj -314 202 pddp/print; | ||
+ | #X obj -263 69 list trim; | ||
+ | #X msg -346 40 test; | ||
+ | #X msg -310 41 TEST; | ||
+ | #X obj -313 153 cyclone/prepend sysex; | ||
+ | #X obj -313 131 cyclone/prepend 40; | ||
+ | #X msg 66 117 samplingInterval \$1; | ||
+ | #X obj 69 93 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144 | ||
+ | -1 -1 0 1; | ||
+ | #X floatatom 27 117 5 0 0 0 - - -; | ||
+ | #X connect 1 0 7 0; | ||
+ | #X connect 2 0 4 0; | ||
+ | #X connect 4 0 1 0; | ||
+ | #X connect 5 0 1 0; | ||
+ | #X connect 6 0 1 0; | ||
+ | #X connect 7 0 3 0; | ||
+ | #X connect 7 0 0 0; | ||
+ | #X connect 8 0 15 0; | ||
+ | #X connect 9 0 11 0; | ||
+ | #X connect 11 0 8 0; | ||
+ | #X connect 12 0 8 0; | ||
+ | #X connect 13 0 8 0; | ||
+ | #X connect 14 0 0 0; | ||
+ | #X connect 14 0 10 0; | ||
+ | #X connect 15 0 14 0; | ||
+ | #X connect 16 0 0 0; | ||
+ | #X connect 17 0 16 0; | ||
+ | #X connect 17 0 18 0; | ||
+ | #X restore 437 242 pd strings and special messages; | ||
+ | #X obj 397 369 route digital version string sysex; | ||
+ | #X text 397 483 released under the GNU GPL v2 or later; | ||
+ | #X text 436 183 which digital ports to enable:; | ||
+ | #N canvas 162 133 610 460 seri 0; | ||
+ | #X obj 59 337 outlet; | ||
+ | #X obj 59 266 trigger bang anything; | ||
+ | #X obj 201 286 list; | ||
+ | #X obj 60 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 0 5 9 1 | ||
+ | 12 -260736 -1 -1 0 1; | ||
+ | #X obj 75 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 1 5 9 1 | ||
+ | 12 -260736 -1 -1 0 1; | ||
+ | #X obj 90 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 2 5 9 1 | ||
+ | 12 -260736 -1 -1 0 1; | ||
+ | #X msg 35 106 0 \$1; | ||
+ | #X msg 70 106 1 \$1; | ||
+ | #X msg 105 106 2 \$1; | ||
+ | #X msg 202 307 set \$1 \$2 \$3; | ||
+ | #X msg 59 210 digitalIns \$1 \$2; | ||
+ | #X connect 1 0 0 0; | ||
+ | #X connect 1 1 2 0; | ||
+ | #X connect 2 0 9 0; | ||
+ | #X connect 3 0 6 0; | ||
+ | #X connect 4 0 7 0; | ||
+ | #X connect 5 0 8 0; | ||
+ | #X connect 6 0 10 0; | ||
+ | #X connect 7 0 10 0; | ||
+ | #X connect 8 0 10 0; | ||
+ | #X connect 9 0 0 0; | ||
+ | #X connect 10 0 1 0; | ||
+ | #X coords 0 -1 1 1 45 16 1 60 60; | ||
+ | #X restore 437 200 pd seri; | ||
+ | #X text 13 6 The [arduino] object works with the Firmata firmware for | ||
+ | Arduino (also known as Pduino firmware).; | ||
+ | #N canvas 623 75 404 287 device 0; | ||
+ | #X obj 35 60 inlet; | ||
+ | #X obj 35 118 route open port ports; | ||
+ | #X obj 35 169 tgl 15 0 empty empty open -3 20 0 10 -262144 -1 -1 0 | ||
+ | 1; | ||
+ | #X floatatom 76 170 5 0 0 3 port - -; | ||
+ | #X obj 117 170 print comport_ports; | ||
+ | #X obj 252 170 outlet; | ||
+ | #X obj 235 74 receive ARDUINO_TEST_RESET; | ||
+ | #X obj 235 97 bang; | ||
+ | #X connect 0 0 1 0; | ||
+ | #X connect 1 0 2 0; | ||
+ | #X connect 1 1 3 0; | ||
+ | #X connect 1 2 4 0; | ||
+ | #X connect 1 3 5 0; | ||
+ | #X connect 6 0 7 0; | ||
+ | #X connect 7 0 5 0; | ||
+ | #X restore 397 295 pd device info; | ||
+ | #N canvas 0 22 450 300 sysex 0; | ||
+ | #X obj 139 19 inlet; | ||
+ | #X obj 127 109 moocow/string2any 32 -1; | ||
+ | #X obj 127 170 print STRING; | ||
+ | #X obj 97 55 list split 1; | ||
+ | #X obj 40 109 print COMMAND; | ||
+ | #X obj 210 54 print sysex; | ||
+ | #X connect 0 0 3 0; | ||
+ | #X connect 0 0 5 0; | ||
+ | #X connect 1 0 2 0; | ||
+ | #X connect 3 0 4 0; | ||
+ | #X connect 3 1 1 0; | ||
+ | #X restore 547 393 pd sysex; | ||
+ | #X text 489 295 <- open to see info; | ||
+ | #X text 371 13 turn on output mode for each pin:; | ||
+ | #N canvas 395 421 446 317 pinMode 0; | ||
+ | #X obj 92 267 outlet; | ||
+ | #X obj 122 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 2 2 -8 0 10 -261682 -1 -1 0; | ||
+ | #X obj 132 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 3 2 -8 0 10 -261682 -1 -1 0; | ||
+ | #X obj 142 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 4 2 -8 0 10 -261682 -1 -1 0; | ||
+ | #X obj 152 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 5 2 -8 0 10 -261682 -1 -1 0; | ||
+ | #X obj 162 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 6 2 -8 0 10 -261682 -1 -1 0; | ||
+ | #X obj 172 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 7 2 -8 0 10 -261682 -1 -1 0; | ||
+ | #X obj 182 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 8 2 -8 0 10 -261682 -1 -1 0; | ||
+ | #X obj 192 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 9 2 -8 0 10 -261682 -1 -1 0; | ||
+ | #X obj 202 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 10 0 -8 0 8 -261682 -1 -1 0; | ||
+ | #X obj 212 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 11 0 -8 0 8 -261682 -1 -1 0; | ||
+ | #X obj 222 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 12 0 -8 0 8 -261682 -1 -1 0; | ||
+ | #X obj 232 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 13 0 -8 0 8 -261682 -1 -1 0; | ||
+ | #X obj 242 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 14 0 -8 0 8 -261682 -1 -1 2; | ||
+ | #X obj 252 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 15 0 -8 0 8 -261682 -1 -1 2; | ||
+ | #X obj 262 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 16 0 -8 0 8 -261682 -1 -1 2; | ||
+ | #X obj 272 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 17 0 -8 0 8 -261682 -1 -1 2; | ||
+ | #X obj 282 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 18 0 -8 0 8 -261682 -1 -1 2; | ||
+ | #X obj 292 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 19 0 -8 0 8 -261682 -1 -1 2; | ||
+ | #X obj 302 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 20 0 -8 0 8 -261682 -1 -1 2; | ||
+ | #X obj 312 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 21 0 -8 0 8 -261682 -1 -1 2; | ||
+ | #N canvas 59 587 1064 355 send-to-arduino---------------------- 0; | ||
+ | #X obj 49 24 inlet; | ||
+ | #X obj 89 24 inlet; | ||
+ | #X obj 128 24 inlet; | ||
+ | #X obj 168 24 inlet; | ||
+ | #X obj 208 24 inlet; | ||
+ | #X obj 248 24 inlet; | ||
+ | #X obj 287 24 inlet; | ||
+ | #X obj 327 24 inlet; | ||
+ | #X obj 368 23 inlet; | ||
+ | #X obj 408 23 inlet; | ||
+ | #X obj 447 23 inlet; | ||
+ | #X obj 487 23 inlet; | ||
+ | #X obj 527 23 inlet; | ||
+ | #X msg 49 66 pinMode 0 \$1; | ||
+ | #X msg 89 88 pinMode 1 \$1; | ||
+ | #X msg 128 110 pinMode 2 \$1; | ||
+ | #X msg 168 130 pinMode 3 \$1; | ||
+ | #X msg 208 62 pinMode 4 \$1; | ||
+ | #X msg 248 84 pinMode 5 \$1; | ||
+ | #X msg 287 106 pinMode 6 \$1; | ||
+ | #X msg 327 126 pinMode 7 \$1; | ||
+ | #X msg 368 58 pinMode 8 \$1; | ||
+ | #X msg 408 80 pinMode 9 \$1; | ||
+ | #X msg 447 102 pinMode 10 \$1; | ||
+ | #X msg 487 122 pinMode 11 \$1; | ||
+ | #X msg 527 50 pinMode 12 \$1; | ||
+ | #X obj 566 23 inlet; | ||
+ | #X msg 566 70 pinMode 13 \$1; | ||
+ | #X obj 481 295 outlet; | ||
+ | #X obj 481 256 trigger bang anything; | ||
+ | #X obj 481 209 list prepend set; | ||
+ | #X obj 481 233 list trim; | ||
+ | #X obj 607 23 inlet; | ||
+ | #X obj 647 23 inlet; | ||
+ | #X obj 687 23 inlet; | ||
+ | #X obj 726 23 inlet; | ||
+ | #X obj 767 23 inlet; | ||
+ | #X obj 807 23 inlet; | ||
+ | #X obj 847 23 inlet; | ||
+ | #X obj 886 23 inlet; | ||
+ | #X msg 607 102 pinMode 14 \$1; | ||
+ | #X msg 647 122 pinMode 15 \$1; | ||
+ | #X msg 687 50 pinMode 16 \$1; | ||
+ | #X msg 726 70 pinMode 17 \$1; | ||
+ | #X msg 767 102 pinMode 18 \$1; | ||
+ | #X msg 807 122 pinMode 19 \$1; | ||
+ | #X msg 847 50 pinMode 20 \$1; | ||
+ | #X msg 886 70 pinMode 21 \$1; | ||
+ | #X obj 927 23 inlet; | ||
+ | #X obj 967 23 inlet; | ||
+ | #X msg 927 102 pinMode 22 \$1; | ||
+ | #X msg 967 122 pinMode 23 \$1; | ||
+ | #X connect 0 0 13 0; | ||
+ | #X connect 1 0 14 0; | ||
+ | #X connect 2 0 15 0; | ||
+ | #X connect 3 0 16 0; | ||
+ | #X connect 4 0 17 0; | ||
+ | #X connect 5 0 18 0; | ||
+ | #X connect 6 0 19 0; | ||
+ | #X connect 7 0 20 0; | ||
+ | #X connect 8 0 21 0; | ||
+ | #X connect 9 0 22 0; | ||
+ | #X connect 10 0 23 0; | ||
+ | #X connect 11 0 24 0; | ||
+ | #X connect 12 0 25 0; | ||
+ | #X connect 13 0 30 0; | ||
+ | #X connect 14 0 30 0; | ||
+ | #X connect 15 0 30 0; | ||
+ | #X connect 16 0 30 0; | ||
+ | #X connect 17 0 30 0; | ||
+ | #X connect 18 0 30 0; | ||
+ | #X connect 19 0 30 0; | ||
+ | #X connect 20 0 30 0; | ||
+ | #X connect 21 0 30 0; | ||
+ | #X connect 22 0 30 0; | ||
+ | #X connect 23 0 30 0; | ||
+ | #X connect 24 0 30 0; | ||
+ | #X connect 25 0 30 0; | ||
+ | #X connect 26 0 27 0; | ||
+ | #X connect 27 0 30 0; | ||
+ | #X connect 29 0 28 0; | ||
+ | #X connect 29 1 28 0; | ||
+ | #X connect 30 0 31 0; | ||
+ | #X connect 31 0 29 0; | ||
+ | #X connect 32 0 40 0; | ||
+ | #X connect 33 0 41 0; | ||
+ | #X connect 34 0 42 0; | ||
+ | #X connect 35 0 43 0; | ||
+ | #X connect 36 0 44 0; | ||
+ | #X connect 37 0 45 0; | ||
+ | #X connect 38 0 46 0; | ||
+ | #X connect 39 0 47 0; | ||
+ | #X connect 40 0 30 0; | ||
+ | #X connect 41 0 30 0; | ||
+ | #X connect 42 0 30 0; | ||
+ | #X connect 43 0 30 0; | ||
+ | #X connect 44 0 30 0; | ||
+ | #X connect 45 0 30 0; | ||
+ | #X connect 46 0 30 0; | ||
+ | #X connect 47 0 30 0; | ||
+ | #X connect 48 0 50 0; | ||
+ | #X connect 49 0 51 0; | ||
+ | #X connect 50 0 30 0; | ||
+ | #X connect 51 0 30 0; | ||
+ | #X restore 94 179 pd send-to-arduino----------------------; | ||
+ | #X obj 322 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 22 0 -8 0 8 -261682 -1 -1 2; | ||
+ | #X obj 332 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET | ||
+ | 23 0 -8 0 8 -261682 -1 -1 2; | ||
+ | #X obj 100 100 cnv 10 10 50 empty empty Rx 0 23 0 10 -191407 -86277 | ||
+ | 0; | ||
+ | #X obj 111 100 cnv 10 10 50 empty empty Tx 0 23 0 10 -191407 -13381 | ||
+ | 0; | ||
+ | #X connect 1 0 21 2; | ||
+ | #X connect 2 0 21 3; | ||
+ | #X connect 3 0 21 4; | ||
+ | #X connect 4 0 21 5; | ||
+ | #X connect 5 0 21 6; | ||
+ | #X connect 6 0 21 7; | ||
+ | #X connect 7 0 21 8; | ||
+ | #X connect 8 0 21 9; | ||
+ | #X connect 9 0 21 10; | ||
+ | #X connect 10 0 21 11; | ||
+ | #X connect 11 0 21 12; | ||
+ | #X connect 12 0 21 13; | ||
+ | #X connect 13 0 21 14; | ||
+ | #X connect 14 0 21 15; | ||
+ | #X connect 15 0 21 16; | ||
+ | #X connect 16 0 21 17; | ||
+ | #X connect 17 0 21 18; | ||
+ | #X connect 18 0 21 19; | ||
+ | #X connect 19 0 21 20; | ||
+ | #X connect 20 0 21 21; | ||
+ | #X connect 21 0 0 0; | ||
+ | #X connect 22 0 21 22; | ||
+ | #X connect 23 0 21 23; | ||
+ | #X coords 0 -1 1 1 242 50 2 100 100; | ||
+ | #X restore 319 60 pd pinMode; | ||
+ | #X text 576 95 servo; | ||
+ | #X text 576 85 pwm; | ||
+ | #X text 576 57 input; | ||
+ | #X text 576 66 output; | ||
+ | #X text 576 76 analog; | ||
+ | #N canvas 66 58 423 503 analog 0; | ||
+ | #X obj 38 10 inlet; | ||
+ | #X obj 131 10 inlet; | ||
+ | #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 msg 37 308 analog \$1 \$2; | ||
+ | #X connect 0 0 11 0; | ||
+ | #X connect 1 0 10 0; | ||
+ | #X connect 2 0 17 0; | ||
+ | #X connect 3 0 8 0; | ||
+ | #X connect 3 0 2 1; | ||
+ | #X connect 3 1 9 0; | ||
+ | #X connect 3 1 4 1; | ||
+ | #X connect 4 0 17 0; | ||
+ | #X connect 7 0 2 0; | ||
+ | #X connect 7 1 4 0; | ||
+ | #X connect 8 0 7 0; | ||
+ | #X connect 9 0 7 0; | ||
+ | #X connect 10 0 12 0; | ||
+ | #X connect 11 0 7 1; | ||
+ | #X connect 12 0 11 0; | ||
+ | #X connect 12 1 3 0; | ||
+ | #X connect 14 0 13 0; | ||
+ | #X connect 14 1 15 0; | ||
+ | #X connect 15 0 16 0; | ||
+ | #X connect 16 0 13 0; | ||
+ | #X connect 17 0 14 0; | ||
+ | #X restore 31 125 pd analog; | ||
+ | #X text 34 84 (switch pin to PWM or servo first); | ||
+ | #X obj -230 160 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577 | ||
+ | 0; | ||
+ | #X obj -168 119 hsl 150 17 0 1 0 0 empty ARDUINO_TEST_RESET analog_output_(0-1) | ||
+ | 20 9 1 10 -225271 -1 -1 0 0; | ||
+ | #X obj -223 81 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124 | ||
+ | -1 -1 0; | ||
+ | #X text -114 67 7; | ||
+ | #X text -221 67 0; | ||
+ | #X text -73 67 10; | ||
+ | #X text -27 67 13; | ||
+ | #X text -162 67 4; | ||
+ | #X text -192 67 2; | ||
+ | #X text -146 67 5; | ||
+ | #X text -131 67 6; | ||
+ | #X text -176 67 3; | ||
+ | #X text -100 67 8; | ||
+ | #X text -83 67 9; | ||
+ | #X text -57 67 11; | ||
+ | #X text -42 67 12; | ||
+ | #X text -206 67 1; | ||
+ | #X msg -222 162 analog 0 0; | ||
+ | #N canvas 66 58 423 503 analog 0; | ||
+ | #X obj 38 10 inlet; | ||
+ | #X obj 131 10 inlet; | ||
+ | #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 msg 37 308 analog \$1 \$2; | ||
+ | #X connect 0 0 11 0; | ||
+ | #X connect 1 0 10 0; | ||
+ | #X connect 2 0 17 0; | ||
+ | #X connect 3 0 8 0; | ||
+ | #X connect 3 0 2 1; | ||
+ | #X connect 3 1 9 0; | ||
+ | #X connect 3 1 4 1; | ||
+ | #X connect 4 0 17 0; | ||
+ | #X connect 7 0 2 0; | ||
+ | #X connect 7 1 4 0; | ||
+ | #X connect 8 0 7 0; | ||
+ | #X connect 9 0 7 0; | ||
+ | #X connect 10 0 12 0; | ||
+ | #X connect 11 0 7 1; | ||
+ | #X connect 12 0 11 0; | ||
+ | #X connect 12 1 3 0; | ||
+ | #X connect 14 0 13 0; | ||
+ | #X connect 14 1 15 0; | ||
+ | #X connect 15 0 16 0; | ||
+ | #X connect 16 0 13 0; | ||
+ | #X connect 17 0 14 0; | ||
+ | #X restore -222 140 pd analog; | ||
+ | #X text -219 99 (switch pin to PWM or servo first); | ||
+ | #X obj 6 286 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577 | ||
+ | 0; | ||
+ | #X obj 68 245 hsl 150 17 0 1 0 0 empty ARDUINO_TEST_RESET analog_output_(0-1) | ||
+ | 20 9 1 10 -225271 -1 -1 0 0; | ||
+ | #X obj 13 207 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124 -1 | ||
+ | -1 0; | ||
+ | #X text 122 193 7; | ||
+ | #X text 15 193 0; | ||
+ | #X text 163 193 10; | ||
+ | #X text 209 193 13; | ||
+ | #X text 74 193 4; | ||
+ | #X text 44 193 2; | ||
+ | #X text 90 193 5; | ||
+ | #X text 105 193 6; | ||
+ | #X text 60 193 3; | ||
+ | #X text 136 193 8; | ||
+ | #X text 153 193 9; | ||
+ | #X text 179 193 11; | ||
+ | #X text 194 193 12; | ||
+ | #X text 30 193 1; | ||
+ | #X msg 14 288 analog 0 0; | ||
+ | #N canvas 66 58 423 503 analog 0; | ||
+ | #X obj 38 10 inlet; | ||
+ | #X obj 131 10 inlet; | ||
+ | #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 msg 37 308 analog \$1 \$2; | ||
+ | #X connect 0 0 11 0; | ||
+ | #X connect 1 0 10 0; | ||
+ | #X connect 2 0 17 0; | ||
+ | #X connect 3 0 8 0; | ||
+ | #X connect 3 0 2 1; | ||
+ | #X connect 3 1 9 0; | ||
+ | #X connect 3 1 4 1; | ||
+ | #X connect 4 0 17 0; | ||
+ | #X connect 7 0 2 0; | ||
+ | #X connect 7 1 4 0; | ||
+ | #X connect 8 0 7 0; | ||
+ | #X connect 9 0 7 0; | ||
+ | #X connect 10 0 12 0; | ||
+ | #X connect 11 0 7 1; | ||
+ | #X connect 12 0 11 0; | ||
+ | #X connect 12 1 3 0; | ||
+ | #X connect 14 0 13 0; | ||
+ | #X connect 14 1 15 0; | ||
+ | #X connect 15 0 16 0; | ||
+ | #X connect 16 0 13 0; | ||
+ | #X connect 17 0 14 0; | ||
+ | #X restore 14 266 pd analog; | ||
+ | #X text 18 225 (switch pin to PWM or servo first); | ||
+ | #X obj -216 291 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577 | ||
+ | 0; | ||
+ | #X obj -154 250 hsl 150 17 0 1 0 0 empty ARDUINO_TEST_RESET analog_output_(0-1) | ||
+ | 20 9 1 10 -225271 -1 -1 0 0; | ||
+ | #X obj -209 212 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124 | ||
+ | -1 -1 0; | ||
+ | #X text -100 198 7; | ||
+ | #X text -207 198 0; | ||
+ | #X text -59 198 10; | ||
+ | #X text -13 198 13; | ||
+ | #X text -148 198 4; | ||
+ | #X text -178 198 2; | ||
+ | #X text -132 198 5; | ||
+ | #X text -117 198 6; | ||
+ | #X text -162 198 3; | ||
+ | #X text -86 198 8; | ||
+ | #X text -69 198 9; | ||
+ | #X text -43 198 11; | ||
+ | #X text -28 198 12; | ||
+ | #X text -192 198 1; | ||
+ | #X msg -208 293 analog 0 0; | ||
+ | #N canvas 66 58 423 503 analog 0; | ||
+ | #X obj 38 10 inlet; | ||
+ | #X obj 131 10 inlet; | ||
+ | #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 msg 37 308 analog \$1 \$2; | ||
+ | #X connect 0 0 11 0; | ||
+ | #X connect 1 0 10 0; | ||
+ | #X connect 2 0 17 0; | ||
+ | #X connect 3 0 8 0; | ||
+ | #X connect 3 0 2 1; | ||
+ | #X connect 3 1 9 0; | ||
+ | #X connect 3 1 4 1; | ||
+ | #X connect 4 0 17 0; | ||
+ | #X connect 7 0 2 0; | ||
+ | #X connect 7 1 4 0; | ||
+ | #X connect 8 0 7 0; | ||
+ | #X connect 9 0 7 0; | ||
+ | #X connect 10 0 12 0; | ||
+ | #X connect 11 0 7 1; | ||
+ | #X connect 12 0 11 0; | ||
+ | #X connect 12 1 3 0; | ||
+ | #X connect 14 0 13 0; | ||
+ | #X connect 14 1 15 0; | ||
+ | #X connect 15 0 16 0; | ||
+ | #X connect 16 0 13 0; | ||
+ | #X connect 17 0 14 0; | ||
+ | #X restore -208 271 pd analog; | ||
+ | #X text -205 230 (switch pin to PWM or servo first); | ||
+ | #X obj -224 -52 dumpOSC 8000; | ||
+ | #X floatatom -185 4 5 0 0 0 - - -; | ||
+ | #X obj -226 -18 OSCroute /1; | ||
+ | #X obj -195 38 s page-1; | ||
+ | #X obj -106 -141 r page-1; | ||
+ | #X floatatom -106 -63 5 0 0 0 - - -; | ||
+ | #X obj -106 -119 OSCroute /fb /lr; | ||
+ | #X obj -106 -90 moses 0.5; | ||
+ | #X obj -106 -34 * -1; | ||
+ | #X floatatom -106 40 5 0 0 0 - - -; | ||
+ | #X obj -106 -10 + 0.5; | ||
+ | #X obj -106 16 * 2; | ||
+ | #X floatatom -55 -5 5 0 0 0 - - -; | ||
+ | #X obj -55 -59 - 0.5; | ||
+ | #X obj -55 -29 * 2; | ||
+ | #X floatatom 1 -65 5 0 0 0 - - -; | ||
+ | #X obj 1 -92 moses 0.5; | ||
+ | #X obj 1 -36 * -1; | ||
+ | #X floatatom 1 38 5 0 0 0 - - -; | ||
+ | #X obj 1 -12 + 0.5; | ||
+ | #X obj 1 14 * 2; | ||
+ | #X floatatom 52 -7 5 0 0 0 - - -; | ||
+ | #X obj 52 -61 - 0.5; | ||
+ | #X obj 52 -31 * 2; | ||
+ | #X connect 3 0 70 0; | ||
+ | #X connect 4 0 3 0; | ||
+ | #X connect 4 1 6 0; | ||
+ | #X connect 6 0 70 0; | ||
+ | #X connect 7 0 91 1; | ||
+ | #X connect 8 0 37 1; | ||
+ | #X connect 9 0 70 0; | ||
+ | #X connect 10 0 70 0; | ||
+ | #X connect 11 0 10 0; | ||
+ | #X connect 19 0 91 0; | ||
+ | #X connect 34 0 70 0; | ||
+ | #X connect 35 0 70 0; | ||
+ | #X connect 36 0 70 0; | ||
+ | #X connect 37 0 44 0; | ||
+ | #X connect 38 0 70 0; | ||
+ | #X connect 39 0 70 0; | ||
+ | #X connect 40 0 39 0; | ||
+ | #X connect 44 0 45 0; | ||
+ | #X connect 44 1 76 0; | ||
+ | #X connect 45 0 46 0; | ||
+ | #X connect 45 1 46 1; | ||
+ | #X connect 45 2 46 2; | ||
+ | #X connect 45 3 46 3; | ||
+ | #X connect 45 4 46 4; | ||
+ | #X connect 45 5 46 5; | ||
+ | #X connect 45 6 46 6; | ||
+ | #X connect 45 7 46 7; | ||
+ | #X connect 46 0 12 0; | ||
+ | #X connect 46 1 13 0; | ||
+ | #X connect 46 2 14 0; | ||
+ | #X connect 46 3 15 0; | ||
+ | #X connect 46 4 16 0; | ||
+ | #X connect 46 5 17 0; | ||
+ | #X connect 46 6 42 0; | ||
+ | #X connect 46 7 43 0; | ||
+ | #X connect 47 2 48 0; | ||
+ | #X connect 47 3 49 0; | ||
+ | #X connect 47 4 50 0; | ||
+ | #X connect 47 5 51 0; | ||
+ | #X connect 47 6 52 0; | ||
+ | #X connect 47 7 53 0; | ||
+ | #X connect 47 8 54 0; | ||
+ | #X connect 47 9 55 0; | ||
+ | #X connect 47 10 56 0; | ||
+ | #X connect 47 11 57 0; | ||
+ | #X connect 47 12 58 0; | ||
+ | #X connect 47 13 59 0; | ||
+ | #X connect 61 0 71 0; | ||
+ | #X connect 62 0 63 0; | ||
+ | #X connect 62 1 64 0; | ||
+ | #X connect 70 0 37 0; | ||
+ | #X connect 70 1 81 0; | ||
+ | #X connect 72 0 70 0; | ||
+ | #X connect 73 0 70 0; | ||
+ | #X connect 75 0 70 0; | ||
+ | #X connect 76 0 47 0; | ||
+ | #X connect 76 1 62 0; | ||
+ | #X connect 76 2 74 0; | ||
+ | #X connect 76 3 82 0; | ||
+ | #X connect 79 0 9 0; | ||
+ | #X connect 81 0 61 0; | ||
+ | #X connect 85 0 38 0; | ||
+ | #X connect 91 0 34 0; | ||
+ | #X connect 94 0 111 1; | ||
+ | #X connect 95 0 111 0; | ||
+ | #X connect 110 0 70 0; | ||
+ | #X connect 111 0 110 0; | ||
+ | #X connect 114 0 131 1; | ||
+ | #X connect 115 0 131 0; | ||
+ | #X connect 130 0 70 0; | ||
+ | #X connect 131 0 130 0; | ||
+ | #X connect 134 0 151 1; | ||
+ | #X connect 135 0 151 0; | ||
+ | #X connect 150 0 70 0; | ||
+ | #X connect 151 0 150 0; | ||
+ | #X connect 153 0 155 0; | ||
+ | #X connect 155 0 154 0; | ||
+ | #X connect 155 0 156 0; | ||
+ | #X connect 157 0 159 0; | ||
+ | #X connect 158 0 161 0; | ||
+ | #X connect 159 0 160 0; | ||
+ | #X connect 159 1 169 0; | ||
+ | #X connect 160 0 158 0; | ||
+ | #X connect 160 1 166 0; | ||
+ | #X connect 161 0 163 0; | ||
+ | #X connect 162 0 91 1; | ||
+ | #X connect 163 0 164 0; | ||
+ | #X connect 164 0 162 0; | ||
+ | #X connect 165 0 111 1; | ||
+ | #X connect 166 0 167 0; | ||
+ | #X connect 167 0 165 0; | ||
+ | #X connect 168 0 170 0; | ||
+ | #X connect 169 0 168 0; | ||
+ | #X connect 169 1 175 0; | ||
+ | #X connect 170 0 172 0; | ||
+ | #X connect 171 0 131 1; | ||
+ | #X connect 172 0 173 0; | ||
+ | #X connect 173 0 171 0; | ||
+ | #X connect 174 0 151 1; | ||
+ | #X connect 175 0 176 0; | ||
+ | #X connect 176 0 174 0; | ||
+ | |||
+ | |||
+ | Code for Arduino (Standard Firmata) | ||
+ | |||
+ | /* | ||
+ | Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved. | ||
+ | |||
+ | This library is free software; you can redistribute it and/or | ||
+ | modify it under the terms of the GNU Lesser General Public | ||
+ | License as published by the Free Software Foundation; either | ||
+ | version 2.1 of the License, or (at your option) any later version. | ||
+ | |||
+ | See file LICENSE.txt for further informations on licensing terms. | ||
+ | |||
+ | formatted using the GNU C formatting and indenting | ||
+ | */ | ||
+ | |||
+ | /* | ||
+ | * TODO: use Program Control to load stored profiles from EEPROM | ||
+ | */ | ||
+ | |||
+ | #include <Firmata.h> | ||
+ | #include <Servo.h> | ||
+ | |||
+ | /*============================================================================== | ||
+ | * GLOBAL VARIABLES | ||
+ | *============================================================================*/ | ||
+ | |||
+ | /* analog inputs */ | ||
+ | int analogInputsToReport = 0; // bitwise array to store pin reporting | ||
+ | int analogPin = 0; // counter for reading analog pins | ||
+ | |||
+ | /* digital pins */ | ||
+ | byte reportPINs[TOTAL_PORTS]; // PIN == input port | ||
+ | byte previousPINs[TOTAL_PORTS]; // PIN == input port | ||
+ | byte pinStatus[TOTAL_DIGITAL_PINS]; // store pin status, default OUTPUT | ||
+ | byte portStatus[TOTAL_PORTS]; | ||
+ | |||
+ | /* timer variables */ | ||
+ | unsigned long currentMillis; // store the current value from millis() | ||
+ | unsigned long nextExecuteMillis; // for comparison with currentMillis | ||
+ | int samplingInterval = 19; // how often to run the main loop (in ms) | ||
+ | |||
+ | Servo servos[MAX_SERVOS]; | ||
+ | |||
+ | /*============================================================================== | ||
+ | * FUNCTIONS | ||
+ | *============================================================================*/ | ||
+ | |||
+ | void outputPort(byte portNumber, byte portValue) | ||
+ | { | ||
+ | portValue = portValue &~ portStatus[portNumber]; | ||
+ | if(previousPINs[portNumber] != portValue) { | ||
+ | Firmata.sendDigitalPort(portNumber, portValue); | ||
+ | previousPINs[portNumber] = portValue; | ||
+ | Firmata.sendDigitalPort(portNumber, portValue); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | /* ----------------------------------------------------------------------------- | ||
+ | * 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) | ||
+ | { | ||
+ | byte i, tmp; | ||
+ | for(i=0; i < TOTAL_PORTS; i++) { | ||
+ | if(reportPINs[i]) { | ||
+ | switch(i) { | ||
+ | case 0: | ||
+ | outputPort(0, PIND &~ B00000011); // ignore Rx/Tx 0/1 | ||
+ | break; | ||
+ | case 1: | ||
+ | outputPort(1, PINB); | ||
+ | break; | ||
+ | case ANALOG_PORT: | ||
+ | outputPort(ANALOG_PORT, PINC); | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ----------------------------------------------------------------------------- | ||
+ | /* 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 setPinModeCallback(byte pin, int mode) { | ||
+ | byte port = 0; | ||
+ | byte offset = 0; | ||
+ | |||
+ | // TODO: abstract for different boards | ||
+ | if (pin < 8) { | ||
+ | port = 0; | ||
+ | offset = 0; | ||
+ | } else if (pin < 14) { | ||
+ | port = 1; | ||
+ | offset = 8; | ||
+ | } else if (pin < 22) { | ||
+ | port = 2; | ||
+ | offset = 14; | ||
+ | } | ||
+ | |||
+ | if(pin > 1) { // ignore RxTx (pins 0 and 1) | ||
+ | if (isServoSupportedPin(pin) && mode != SERVO) | ||
+ | if (servos[pin - FIRST_SERVO_PIN].attached()) | ||
+ | servos[pin - FIRST_SERVO_PIN].detach(); | ||
+ | if(pin > 13) | ||
+ | reportAnalogCallback(pin - 14, mode == ANALOG ? 1 : 0); // turn on/off reporting | ||
+ | switch(mode) { | ||
+ | case ANALOG: | ||
+ | digitalWrite(pin, LOW); // disable internal pull-ups and fall thru to 'case INPUT:' | ||
+ | case INPUT: | ||
+ | pinStatus[pin] = mode; | ||
+ | pinMode(pin, INPUT); | ||
+ | portStatus[port] = portStatus[port] &~ (1 << (pin - offset)); | ||
+ | break; | ||
+ | case OUTPUT: | ||
+ | digitalWrite(pin, LOW); // disable PWM and fall thru to 'case PWM:' | ||
+ | case PWM: | ||
+ | pinStatus[pin] = mode; | ||
+ | pinMode(pin, OUTPUT); | ||
+ | portStatus[port] = portStatus[port] | (1 << (pin - offset)); | ||
+ | break; | ||
+ | case SERVO: | ||
+ | // TODO: Support Arduino Mega | ||
+ | if (isServoSupportedPin(pin)) { | ||
+ | pinStatus[pin] = mode; | ||
+ | if (!servos[pin - FIRST_SERVO_PIN].attached()) | ||
+ | servos[pin - FIRST_SERVO_PIN].attach(pin); | ||
+ | } else | ||
+ | Firmata.sendString("Servo only on pins from 2 to 13"); | ||
+ | break; | ||
+ | case I2C: | ||
+ | pinStatus[pin] = mode; | ||
+ | Firmata.sendString("I2C mode not yet supported"); | ||
+ | break; | ||
+ | default: | ||
+ | Firmata.sendString("Unknown pin mode"); // TODO: put error msgs in EEPROM | ||
+ | } | ||
+ | // TODO: save status to EEPROM here, if changed | ||
+ | } | ||
+ | } | ||
+ | |||
+ | void analogWriteCallback(byte pin, int value) | ||
+ | { | ||
+ | switch(pinStatus[pin]) { | ||
+ | case SERVO: | ||
+ | if (isServoSupportedPin(pin)) | ||
+ | servos[pin - FIRST_SERVO_PIN].write(value); | ||
+ | break; | ||
+ | case PWM: | ||
+ | analogWrite(pin, value); | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | void digitalWriteCallback(byte port, int value) | ||
+ | { | ||
+ | switch(port) { | ||
+ | case 0: // pins 2-7 (don't change Rx/Tx, pins 0 and 1) | ||
+ | // 0xFF03 == B1111111100000011 0x03 == B00000011 | ||
+ | PORTD = (value &~ 0xFF03) | (PORTD & 0x03); | ||
+ | break; | ||
+ | case 1: // pins 8-13 (14,15 are disabled for the crystal) | ||
+ | PORTB = (byte)value; | ||
+ | break; | ||
+ | case 2: // analog pins used as digital | ||
+ | byte pin; | ||
+ | byte pinModeMask; | ||
+ | for(pin=0; pin<8; pin++) | ||
+ | if(pinStatus[pin] == OUTPUT) | ||
+ | pinModeMask += 1 << pin; | ||
+ | PORTC = (byte)value & pinModeMask; | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // ----------------------------------------------------------------------------- | ||
+ | /* sets bits in a bit array (int) to toggle the reporting of the analogIns | ||
+ | */ | ||
+ | //void FirmataClass::setAnalogPinReporting(byte pin, byte state) { | ||
+ | //} | ||
+ | void reportAnalogCallback(byte pin, int value) | ||
+ | { | ||
+ | if(value == 0) { | ||
+ | analogInputsToReport = analogInputsToReport &~ (1 << pin); | ||
+ | } | ||
+ | else { // everything but 0 enables reporting of that pin | ||
+ | analogInputsToReport = analogInputsToReport | (1 << pin); | ||
+ | } | ||
+ | // TODO: save status to EEPROM here, if changed | ||
+ | } | ||
+ | |||
+ | void reportDigitalCallback(byte port, int value) | ||
+ | { | ||
+ | reportPINs[port] = (byte)value; | ||
+ | if(port == ANALOG_PORT) // turn off analog reporting when used as digital | ||
+ | analogInputsToReport = 0; | ||
+ | } | ||
+ | |||
+ | /*============================================================================== | ||
+ | * SYSEX-BASED commands | ||
+ | *============================================================================*/ | ||
+ | |||
+ | void sysexCallback(byte command, byte argc, byte *argv) | ||
+ | { | ||
+ | switch(command) { | ||
+ | case SERVO_CONFIG: | ||
+ | if(argc > 4) { | ||
+ | // these vars are here for clarity, they'll optimized away by the compiler | ||
+ | byte pin = argv[0]; | ||
+ | int minPulse = argv[1] + (argv[2] << 7); | ||
+ | int maxPulse = argv[3] + (argv[4] << 7); | ||
+ | |||
+ | if (isServoSupportedPin(pin)) { | ||
+ | // servos are pins from 2 to 13, so offset for array | ||
+ | if (servos[pin - FIRST_SERVO_PIN].attached()) | ||
+ | servos[pin - FIRST_SERVO_PIN].detach(); | ||
+ | servos[pin - FIRST_SERVO_PIN].attach(pin, minPulse, maxPulse); | ||
+ | setPinModeCallback(pin, SERVO); | ||
+ | } | ||
+ | } | ||
+ | break; | ||
+ | case SAMPLING_INTERVAL: | ||
+ | if (argc > 1) | ||
+ | samplingInterval = argv[0] + (argv[1] << 7); | ||
+ | else | ||
+ | Firmata.sendString("Not enough data"); | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | boolean isServoSupportedPin(byte pin) | ||
+ | { | ||
+ | return ((FIRST_SERVO_PIN <= pin) && (pin <= (FIRST_SERVO_PIN + MAX_SERVOS))); | ||
+ | } | ||
+ | |||
+ | /*============================================================================== | ||
+ | * SETUP() | ||
+ | *============================================================================*/ | ||
+ | void setup() | ||
+ | { | ||
+ | byte i; | ||
+ | |||
+ | Firmata.setFirmwareVersion(2, 1); | ||
+ | |||
+ | Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); | ||
+ | Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback); | ||
+ | Firmata.attach(REPORT_ANALOG, reportAnalogCallback); | ||
+ | Firmata.attach(REPORT_DIGITAL, reportDigitalCallback); | ||
+ | Firmata.attach(SET_PIN_MODE, setPinModeCallback); | ||
+ | Firmata.attach(START_SYSEX, sysexCallback); | ||
+ | |||
+ | portStatus[0] = B00000011; // ignore Tx/RX pins | ||
+ | portStatus[1] = B11000000; // ignore 14/15 pins | ||
+ | portStatus[2] = B00000000; | ||
+ | |||
+ | for(i=0; i < FIRST_ANALOG_PIN; ++i) { | ||
+ | setPinModeCallback(i,OUTPUT); | ||
+ | } | ||
+ | // set all outputs to 0 to make sure internal pull-up resistors are off | ||
+ | PORTB = 0; // pins 8-15 | ||
+ | PORTC = 0; // analog port | ||
+ | PORTD = 0; // pins 0-7 | ||
+ | |||
+ | // TODO rethink the init, perhaps it should report analog on default | ||
+ | for(i=0; i<TOTAL_PORTS; ++i) { | ||
+ | reportPINs[i] = false; | ||
+ | } | ||
+ | // TODO: load state from EEPROM here | ||
+ | |||
+ | /* send digital inputs here, if enabled, to set the initial state on the | ||
+ | * host computer, since once in the loop(), this firmware will only send | ||
+ | * digital data on change. */ | ||
+ | if(reportPINs[0]) outputPort(0, PIND &~ B00000011); // ignore Rx/Tx 0/1 | ||
+ | if(reportPINs[1]) outputPort(1, PINB); | ||
+ | if(reportPINs[ANALOG_PORT]) outputPort(ANALOG_PORT, PINC); | ||
+ | |||
+ | Firmata.begin(57600); | ||
+ | } | ||
+ | |||
+ | /*============================================================================== | ||
+ | * LOOP() | ||
+ | *============================================================================*/ | ||
+ | void loop() | ||
+ | { | ||
+ | /* DIGITALREAD - as fast as possible, check for changes and output them to the | ||
+ | * FTDI buffer using Serial.print() */ | ||
+ | checkDigitalInputs(); | ||
+ | currentMillis = millis(); | ||
+ | if(currentMillis > nextExecuteMillis) { | ||
+ | nextExecuteMillis = currentMillis + samplingInterval; | ||
+ | /* SERIALREAD - Serial.read() uses a 128 byte circular buffer, so handle | ||
+ | * all serialReads at once, i.e. empty the buffer */ | ||
+ | while(Firmata.available()) | ||
+ | Firmata.processInput(); | ||
+ | /* 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( analogInputsToReport & (1 << analogPin) ) { | ||
+ | Firmata.sendAnalog(analogPin, analogRead(analogPin)); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | TouchOSC patch | ||
+ | |||
+ | |||
+ | ***CANT UPLOAD ACTUAL FILE***** |
Latest revision as of 14:59, 18 March 2010
My name is Ryan Legge and I am an ICAM major. As far as art goes, I'm not a fine art fan. I appreciate the beauty and skill that these works encompass, but to me, they bring about an air of elitism. I prefer art that is more accessable, interactive, public, subversive. The reason I am an ICAM Music major really has more to do with me not going to school, than my interests in art. I dropped out of school for 6 years, and it was my interests in music, vis arts, and computers that led me into the ICAM program. When I decided to finish my BA, I knew I would have to pursue a major that interested me, or I would likely drop out again due to boredom. I am taking this class because I have a background in electronics that I was able to develop while I was out of school. Specifically, I was introduced to the arduino platform about a year ago, and this class was an opportunity to earn credit and get an in depth exposure to a subject that I was already interested in.
For my final, I plan to implement TouchOSC control of motors/servos to control a robot through Pd with the arduino. ________________ TouchOSC
________________
Pduino
________________
Robot animal
________________
FINAL DOCUMENTATION:
Code used for Final:
- N canvas 331 48 894 684 10;
- X obj 313 116 cnv 15 100 22 empty empty empty 20 12 0 14 -253938 -66577
0;
- X obj 23 145 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577
0;
- X obj 155 170 cnv 15 60 22 empty empty empty 20 12 0 14 -253938 -66577
0;
- X msg 161 172 open 2;
- N canvas 128 22 525 433 serin 0;
- X obj 180 61 cnv 15 15 15 empty \$0-number-canvas 2 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 2;
- 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 377 outlet;
- X msg 201 306 set \$1 \$2;
- X obj 59 266 trigger bang anything;
- X obj 201 286 list;
- X obj 383 383 outlet;
- X obj 384 22 netreceive 34567;
- X obj 477 43 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0
1;
- X obj 384 41 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 -1
-1;
- X obj 187 24 delay 15000;
- X text 345 379 close;
- X text 209 4 for open/close automation in Makefile;
- N canvas 698 22 318 215 reset 0;
- X obj 65 24 inlet;
- X obj 66 58 bang;
- X obj 66 150 send ARDUINO_TEST_RESET;
- X msg 66 129 0;
- X msg 111 99 1;
- X obj 111 120 send ARDUINO_PINMODE_RESET;
- X connect 0 0 1 0;
- X connect 1 0 3 0;
- X connect 1 0 4 0;
- X connect 3 0 2 0;
- X connect 4 0 5 0;
- X restore 172 111 pd reset guis;
- X connect 2 0 6 0;
- X connect 2 0 19 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 connect 13 0 15 0;
- X connect 13 1 14 0;
- X connect 15 0 16 0;
- X connect 15 0 12 0;
- X connect 16 0 2 0;
- X coords 0 -1 1 1 136 17 1 60 60;
- X restore 161 149 pd serin;
- X text 158 131 serial port #;
- X msg 221 172 close;
- X obj 85 104 hsl 150 17 0 1 0 0 empty ARDUINO_TEST_RESET analog_output_(0-1)
20 9 1 10 -225271 -1 -1 0 0;
- X obj 267 302 tgl 15 1 empty empty empty 0 -6 0 8 -225271 -1 -1 1
1;
- X msg 437 220 digitalIns 0 0;
- X msg 437 165 analogIns 0 0;
- N canvas 162 133 610 460 serin 0;
- X obj 59 337 outlet;
- X obj 59 266 trigger bang anything;
- X obj 201 286 list;
- X obj 60 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 0 5 9 1
12 -262130 -1 -1 0 1;
- X obj 75 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 1 5 9 1
12 -262130 -1 -1 0 1;
- X obj 90 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 2 5 9 1
12 -262130 -1 -1 0 1;
- X obj 105 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 3 5 9
1 12 -262130 -1 -1 0 1;
- X obj 120 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 4 5 9
1 12 -262130 -1 -1 0 1;
- X obj 135 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 5 5 9
1 12 -262130 -1 -1 0 1;
- X obj 150 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 6 5 9
1 12 -262130 -1 -1 0 1;
- X obj 165 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 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 437 145 pd serin;
- X floatatom 22 426 5 0 0 3 a0 - -;
- X floatatom 68 426 5 0 0 3 a1 - -;
- X floatatom 114 426 5 0 0 3 a2 - -;
- X floatatom 160 426 5 0 0 3 a3 - -;
- X floatatom 206 426 5 0 0 3 a4 - -;
- X floatatom 252 426 5 0 0 3 a5 - -;
- X text 290 271 <- argument sets port #;
- X obj 30 66 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124 -1
-1 0;
- X text 139 52 7;
- X text 32 52 0;
- X text 180 52 10;
- X text 226 52 13;
- X text 91 52 4;
- X text 61 52 2;
- X text 107 52 5;
- X text 122 52 6;
- X text 77 52 3;
- X text 153 52 8;
- X text 170 52 9;
- X text 196 52 11;
- X text 211 52 12;
- X text 47 52 1;
- X msg 31 147 analog 0 0;
- X msg 319 155 info;
- X msg 358 155 version;
- X obj 220 302 spigot;
- X msg 319 118 pinMode 23 2;
- N canvas 67 22 475 478 sending 0;
- X obj 69 228 cnv 15 100 22 empty empty empty 20 12 0 14 -253938 -66577
0;
- X obj 78 434 outlet;
- X msg 78 231 digital 22 0;
- X obj 127 148 tgl 15 0 empty empty 7 4 -6 1 12 -233017 -1 -1 0 1;
- X obj 144 148 tgl 15 0 empty empty 8 4 -6 1 12 -233017 -1 -1 0 1;
- X obj 161 148 tgl 15 0 empty empty 9 4 -6 1 12 -233017 -1 -1 0 1;
- X obj 178 148 tgl 15 0 empty empty 10 0 -6 1 12 -233017 -1 -1 0 1
- X obj 195 148 tgl 15 0 empty empty 11 0 -6 1 12 -233017 -1 -1 0 1
- X obj 212 148 tgl 15 0 empty empty 12 0 -6 1 12 -233017 -1 -1 0 1
- X obj 229 148 tgl 15 0 empty empty 13 0 -6 1 12 -233017 -1 -1 0 1
- X obj 42 148 tgl 15 0 empty empty 2 4 -6 1 12 -233017 -1 -1 0 1;
- X obj 59 148 tgl 15 0 empty empty 3 4 -6 1 12 -233017 -1 -1 0 1;
- X obj 76 148 tgl 15 0 empty empty 4 4 -6 1 12 -233017 -1 -1 0 1;
- X obj 93 148 tgl 15 0 empty empty 5 4 -6 1 12 -233017 -1 -1 0 1;
- X obj 110 148 tgl 15 0 empty empty 6 4 -6 1 12 -233017 -1 -1 0 1;
- X obj 418 123 tgl 25 0 empty ARDUINO_TEST_RESET ALL 2 12 0 12 -262144
-1 -1 0 1;
- X obj 388 72 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 16383
- X obj 388 92 metro 100;
- X obj 301 9 inlet;
- X obj 8 148 tgl 15 0 empty empty 0 3 -6 1 12 -260818 -1 -1 0 1;
- X obj 25 148 tgl 15 0 empty empty 1 3 -6 1 12 -260818 -1 -1 0 1;
- X obj 8 148 cnv 15 15 15 empty empty Rx 1 10 0 11 -128992 -86277 0
- X obj 25 148 cnv 15 15 15 empty empty Tx 1 10 0 11 -128992 -13381
0;
- X obj 301 43 trigger 0 float;
- X obj 301 64 select 0;
- X msg 301 84 0;
- X msg 405 389 port 1 0;
- X msg 263 389 port 0 0;
- X msg 189 389 port 0 255;
- X msg 331 389 port 1 255;
- X text 95 291 or send 8-bit ports in one message:;
- X msg 159 338 port 1 \$1;
- X msg 91 338 port 0 \$1;
- X msg 230 338 port 2 \$1;
- X obj 362 297 tgl 25 0 empty ARDUINO_TEST_RESET ALL 2 12 0 12 -262144
-1 -1 0 255;
- X obj 362 246 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
16383;
- X obj 362 266 metro 100;
- X floatatom 362 329 5 0 0 0 - - -;
- X obj 246 148 tgl 15 0 empty empty 14 0 -6 1 12 -233017 -1 -1 0 1
- X obj 263 148 tgl 15 0 empty empty 15 0 -6 1 12 -233017 -1 -1 0 1
- X obj 280 148 tgl 15 0 empty empty 16 0 -6 1 12 -233017 -1 -1 0 1
- X obj 297 148 tgl 15 0 empty empty 17 0 -6 1 12 -233017 -1 -1 0 1
- X obj 314 148 tgl 15 0 empty empty 18 0 -6 1 12 -233017 -1 -1 0 1
- X obj 331 148 tgl 15 0 empty empty 19 0 -6 1 12 -233017 -1 -1 0 1
- X obj 348 148 tgl 15 0 empty empty 20 0 -6 1 12 -233017 -1 -1 0 1
- X obj 365 148 tgl 15 0 empty empty 21 0 -6 1 12 -233017 -1 -1 0 1
- N canvas 314 233 1035 340 generate 0;
- X obj 12 24 inlet;
- X obj 52 24 inlet;
- X obj 91 24 inlet;
- X obj 131 24 inlet;
- X obj 171 24 inlet;
- X obj 211 24 inlet;
- X obj 250 24 inlet;
- X obj 290 24 inlet;
- X obj 331 23 inlet;
- X obj 371 23 inlet;
- X obj 410 23 inlet;
- X obj 450 23 inlet;
- X obj 490 23 inlet;
- X msg 12 66 digital 0 \$1;
- X msg 52 88 digital 1 \$1;
- X msg 91 110 digital 2 \$1;
- X msg 131 130 digital 3 \$1;
- X msg 171 62 digital 4 \$1;
- X msg 211 84 digital 5 \$1;
- X msg 250 106 digital 6 \$1;
- X msg 290 126 digital 7 \$1;
- X msg 331 58 digital 8 \$1;
- X msg 371 80 digital 9 \$1;
- X msg 410 102 digital 10 \$1;
- X msg 450 122 digital 11 \$1;
- X msg 490 50 digital 12 \$1;
- X obj 529 23 inlet;
- X msg 529 70 digital 13 \$1;
- X obj 513 302 outlet;
- X obj 513 263 trigger bang anything;
- X obj 513 214 list prepend set;
- X obj 513 238 list trim;
- X obj 570 23 inlet;
- X obj 610 23 inlet;
- X obj 650 23 inlet;
- X obj 689 23 inlet;
- X msg 570 102 digital 14 \$1;
- X msg 610 122 digital 15 \$1;
- X msg 650 50 digital 16 \$1;
- X msg 689 70 digital 17 \$1;
- X obj 730 23 inlet;
- X obj 770 23 inlet;
- X obj 810 23 inlet;
- X obj 849 23 inlet;
- X msg 730 102 digital 18 \$1;
- X msg 770 122 digital 19 \$1;
- X msg 810 50 digital 20 \$1;
- X msg 849 70 digital 21 \$1;
- X obj 890 23 inlet;
- X obj 930 23 inlet;
- X msg 890 102 digital 22 \$1;
- X msg 930 122 digital 23 \$1;
- X connect 0 0 13 0;
- X connect 1 0 14 0;
- X connect 2 0 15 0;
- X connect 3 0 16 0;
- X connect 4 0 17 0;
- X connect 5 0 18 0;
- X connect 6 0 19 0;
- X connect 7 0 20 0;
- X connect 8 0 21 0;
- X connect 9 0 22 0;
- X connect 10 0 23 0;
- X connect 11 0 24 0;
- X connect 12 0 25 0;
- X connect 13 0 30 0;
- X connect 14 0 30 0;
- X connect 15 0 30 0;
- X connect 16 0 30 0;
- X connect 17 0 30 0;
- X connect 18 0 30 0;
- X connect 19 0 30 0;
- X connect 20 0 30 0;
- X connect 21 0 30 0;
- X connect 22 0 30 0;
- X connect 23 0 30 0;
- X connect 24 0 30 0;
- X connect 25 0 30 0;
- X connect 26 0 27 0;
- X connect 27 0 30 0;
- X connect 29 0 28 0;
- X connect 29 1 28 0;
- X connect 30 0 31 0;
- X connect 31 0 29 0;
- X connect 32 0 36 0;
- X connect 33 0 37 0;
- X connect 34 0 38 0;
- X connect 35 0 39 0;
- X connect 36 0 30 0;
- X connect 37 0 30 0;
- X connect 38 0 30 0;
- X connect 39 0 30 0;
- X connect 40 0 44 0;
- X connect 41 0 45 0;
- X connect 42 0 46 0;
- X connect 43 0 47 0;
- X connect 44 0 30 0;
- X connect 45 0 30 0;
- X connect 46 0 30 0;
- X connect 47 0 30 0;
- X connect 48 0 50 0;
- X connect 49 0 51 0;
- X connect 50 0 30 0;
- X connect 51 0 30 0;
- X restore 78 201 pd generate digital out messages ------------------
- X obj 382 148 tgl 15 0 empty empty 22 0 -6 1 12 -233017 -1 -1 0 1
- X obj 399 148 tgl 15 0 empty empty 23 0 -6 1 12 -233017 -1 -1 0 1
- X connect 2 0 1 0;
- X connect 3 0 46 7;
- X connect 4 0 46 8;
- X connect 5 0 46 9;
- X connect 6 0 46 10;
- X connect 7 0 46 11;
- X connect 8 0 46 12;
- X connect 9 0 46 13;
- X connect 10 0 46 2;
- X connect 11 0 46 3;
- X connect 12 0 46 4;
- X connect 13 0 46 5;
- X connect 14 0 46 6;
- X connect 15 0 9 0;
- X connect 15 0 8 0;
- X connect 15 0 7 0;
- X connect 15 0 6 0;
- X connect 15 0 5 0;
- X connect 15 0 4 0;
- X connect 15 0 3 0;
- X connect 15 0 14 0;
- X connect 15 0 13 0;
- X connect 15 0 12 0;
- X connect 15 0 11 0;
- X connect 15 0 10 0;
- X connect 15 0 43 0;
- X connect 15 0 44 0;
- X connect 15 0 45 0;
- X connect 15 0 42 0;
- X connect 15 0 41 0;
- X connect 15 0 40 0;
- X connect 15 0 39 0;
- X connect 15 0 38 0;
- X connect 15 0 48 0;
- X connect 15 0 47 0;
- X connect 16 0 17 0;
- X connect 17 0 15 0;
- X connect 18 0 23 0;
- X connect 23 0 24 0;
- X connect 23 1 16 0;
- X connect 24 0 25 0;
- X connect 25 0 15 0;
- X connect 26 0 1 0;
- X connect 27 0 1 0;
- X connect 28 0 1 0;
- X connect 29 0 1 0;
- X connect 31 0 1 0;
- X connect 32 0 1 0;
- X connect 33 0 1 0;
- X connect 34 0 37 0;
- X connect 34 0 33 0;
- X connect 34 0 31 0;
- X connect 34 0 32 0;
- X connect 35 0 36 0;
- X connect 36 0 34 0;
- X connect 38 0 46 14;
- X connect 39 0 46 15;
- X connect 40 0 46 16;
- X connect 41 0 46 17;
- X connect 42 0 46 18;
- X connect 43 0 46 19;
- X connect 44 0 46 20;
- X connect 45 0 46 21;
- X connect 46 0 2 0;
- X connect 47 0 46 22;
- X connect 48 0 46 23;
- X restore -40 355 pd sending digital outs;
- X obj -39 331 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0
16383;
- X text -16 329 pulse all outputs;
- X floatatom 298 426 5 0 0 3 a6 - -;
- X floatatom 344 426 5 0 0 3 a7 - -;
- X obj 220 324 route analog;
- X obj 121 369 route 0 1 2 3 4 5 6 7;
- N canvas 978 22 499 396 display 0;
- X obj 6 7 inlet;
- X obj 6 28 mapping/resample 100;
- X obj 6 50 outlet;
- X obj 54 50 inlet;
- X obj 54 71 mapping/resample 100;
- X obj 54 93 outlet;
- X obj 103 93 inlet;
- X obj 103 114 mapping/resample 100;
- X obj 103 136 outlet;
- X obj 151 136 inlet;
- X obj 151 157 mapping/resample 100;
- X obj 151 179 outlet;
- X obj 200 179 inlet;
- X obj 200 200 mapping/resample 100;
- X obj 200 222 outlet;
- X obj 247 222 inlet;
- X obj 247 243 mapping/resample 100;
- X obj 247 265 outlet;
- X obj 295 265 inlet;
- X obj 295 286 mapping/resample 100;
- X obj 295 308 outlet;
- X obj 345 308 inlet;
- X obj 345 329 mapping/resample 100;
- X obj 345 351 outlet;
- X obj 60 290 receive ARDUINO_TEST_RESET;
- 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 connect 21 0 22 0;
- X connect 22 0 23 0;
- X connect 24 0 22 0;
- X connect 24 0 19 0;
- X connect 24 0 16 0;
- X connect 24 0 13 0;
- X connect 24 0 10 0;
- X connect 24 0 7 0;
- X connect 24 0 4 0;
- X connect 24 0 1 0;
- X restore 45 400 pd display values without pegging the CPU;
- X obj 397 433 route 0 1 2 3 4 5 6 7 8 9 10 11 12 13;
- X obj 428 455 tgl 15 0 empty ARDUINO_TEST_RESET 2 4 23 1 12 -232448
-1 -1 0 1;
- X obj 445 455 tgl 15 0 empty ARDUINO_TEST_RESET 3 4 23 1 12 -232448
-1 -1 0 1;
- X obj 462 455 tgl 15 0 empty ARDUINO_TEST_RESET 4 4 23 1 12 -232448
-1 -1 0 1;
- X obj 479 455 tgl 15 0 empty ARDUINO_TEST_RESET 5 4 23 1 12 -232448
-1 -1 0 1;
- X obj 496 455 tgl 15 0 empty ARDUINO_TEST_RESET 6 4 23 1 12 -232448
-1 -1 0 1;
- X obj 513 455 tgl 15 0 empty ARDUINO_TEST_RESET 7 4 23 1 12 -232448
-1 -1 0 1;
- X obj 530 455 tgl 15 0 empty ARDUINO_TEST_RESET 8 4 23 1 12 -232448
-1 -1 0 1;
- X obj 547 455 tgl 15 0 empty ARDUINO_TEST_RESET 9 4 23 1 12 -232448
-1 -1 0 1;
- X obj 564 455 tgl 15 0 empty ARDUINO_TEST_RESET 10 0 23 1 12 -232448
-1 -1 0 1;
- X obj 581 455 tgl 15 0 empty ARDUINO_TEST_RESET 11 0 23 1 12 -232448
-1 -1 0 1;
- X obj 598 455 tgl 15 0 empty ARDUINO_TEST_RESET 12 0 23 1 12 -232448
-1 -1 0 1;
- X obj 615 455 tgl 15 0 empty ARDUINO_TEST_RESET 13 0 23 1 12 -232448
-1 -1 0 1;
- X text 2 484 (C) Copyright 2006 Free Software Foundation;
- N canvas 0 22 451 224 ver 0;
- X obj 23 7 inlet;
- X obj 250 100 cnv 15 145 17 empty \$0-version_cnv empty 4 10 0 12
-203904 -1 0;
- X obj 23 157 send \$0-version_cnv;
- X msg 23 132 label \$1;
- X obj 48 103 symbol;
- X obj 38 77 loadbang;
- X msg 96 78 bang;
- X obj 309 163 outlet;
- X obj 23 52 zexy/makesymbol Firmata-%s.%s;
- X obj 23 29 route version bang;
- X connect 0 0 9 0;
- X connect 3 0 2 0;
- X connect 4 0 3 0;
- X connect 5 0 4 0;
- X connect 6 0 4 0;
- X connect 8 0 3 0;
- X connect 9 0 8 0;
- X connect 9 1 7 0;
- X connect 9 1 6 0;
- X connect 9 2 7 0;
- X coords 0 -1 1 1 145 17 1 250 100;
- X restore 397 317 pd ver;
- X obj 414 393 unpack 0 0;
- X floatatom 414 413 5 0 0 0 - - -;
- X floatatom 471 413 5 0 0 0 - - -;
- X obj 394 455 tgl 15 0 empty empty 0 4 23 1 12 -232448 -1 -1 0 1;
- X obj 411 455 tgl 15 0 empty empty 1 4 23 1 12 -232448 -1 -1 0 1;
- X obj 394 455 cnv 15 15 15 empty empty Rx 1 10 0 11 -128992 -86277
0;
- X obj 411 455 cnv 15 15 15 empty empty Tx 1 10 0 11 -128992 -13381
0;
- X text 436 128 which analogIns to enable:;
- X obj 220 272 arduino 1;
- N canvas 649 518 411 212 firmware 0;
- X obj 123 2 inlet;
- X obj 250 100 cnv 15 145 17 empty \$0-firmware_cnv empty 4 10 0 12
-232576 -66577 0;
- X msg 123 156 label \$1;
- X obj 148 127 symbol;
- X obj 138 101 loadbang;
- X msg 196 102 bang;
- X obj 123 181 send \$0-firmware_cnv;
- X obj 123 24 route firmware;
- X obj 18 181 print Firmware;
- X obj 123 49 list;
- X obj 123 80 zexy/makesymbol %s-%s.%s;
- X obj 18 151 list trim;
- X obj 204 45 route bang;
- X connect 0 0 7 0;
- X connect 2 0 6 0;
- X connect 3 0 2 0;
- X connect 4 0 3 0;
- X connect 5 0 3 0;
- X connect 7 0 9 0;
- X connect 7 1 12 0;
- X connect 9 0 10 0;
- X connect 10 0 2 0;
- X connect 10 0 11 0;
- X connect 11 0 8 0;
- X connect 12 0 5 0;
- X coords 0 -1 1 1 145 17 1 250 100;
- X restore 397 337 pd firmware;
- X msg 358 195 devices;
- X msg 358 175 firmware;
- N canvas 0 22 450 300 STRING 0;
- X obj 48 13 inlet;
- X obj 51 93 moocow/string2any 32 -1;
- X obj 51 154 print STRING;
- X connect 0 0 1 0;
- X connect 1 0 2 0;
- X restore 482 393 pd STRING;
- N canvas 205 22 593 390 strings 0;
- X obj -178 287 outlet;
- X obj -142 101 moocow/any2string;
- X symbolatom -92 48 10 0 0 0 - - -;
- X obj -119 179 pddp/print;
- X obj -92 68 list trim;
- X msg -175 39 test;
- X msg -139 40 TEST;
- X obj -142 130 cyclone/prepend string;
- X obj -313 102 moocow/any2string;
- X symbolatom -263 49 10 0 0 0 - - -;
- X obj -314 202 pddp/print;
- X obj -263 69 list trim;
- X msg -346 40 test;
- X msg -310 41 TEST;
- X obj -313 153 cyclone/prepend sysex;
- X obj -313 131 cyclone/prepend 40;
- X msg 66 117 samplingInterval \$1;
- X obj 69 93 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 0 1;
- X floatatom 27 117 5 0 0 0 - - -;
- X connect 1 0 7 0;
- X connect 2 0 4 0;
- X connect 4 0 1 0;
- X connect 5 0 1 0;
- X connect 6 0 1 0;
- X connect 7 0 3 0;
- X connect 7 0 0 0;
- X connect 8 0 15 0;
- X connect 9 0 11 0;
- X connect 11 0 8 0;
- X connect 12 0 8 0;
- X connect 13 0 8 0;
- X connect 14 0 0 0;
- X connect 14 0 10 0;
- X connect 15 0 14 0;
- X connect 16 0 0 0;
- X connect 17 0 16 0;
- X connect 17 0 18 0;
- X restore 437 242 pd strings and special messages;
- X obj 397 369 route digital version string sysex;
- X text 397 483 released under the GNU GPL v2 or later;
- X text 436 183 which digital ports to enable:;
- N canvas 162 133 610 460 seri 0;
- X obj 59 337 outlet;
- X obj 59 266 trigger bang anything;
- X obj 201 286 list;
- X obj 60 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 0 5 9 1
12 -260736 -1 -1 0 1;
- X obj 75 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 1 5 9 1
12 -260736 -1 -1 0 1;
- X obj 90 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 2 5 9 1
12 -260736 -1 -1 0 1;
- X msg 35 106 0 \$1;
- X msg 70 106 1 \$1;
- X msg 105 106 2 \$1;
- X msg 202 307 set \$1 \$2 \$3;
- X msg 59 210 digitalIns \$1 \$2;
- X connect 1 0 0 0;
- X connect 1 1 2 0;
- X connect 2 0 9 0;
- X connect 3 0 6 0;
- X connect 4 0 7 0;
- X connect 5 0 8 0;
- X connect 6 0 10 0;
- X connect 7 0 10 0;
- X connect 8 0 10 0;
- X connect 9 0 0 0;
- X connect 10 0 1 0;
- X coords 0 -1 1 1 45 16 1 60 60;
- X restore 437 200 pd seri;
- X text 13 6 The [arduino] object works with the Firmata firmware for
Arduino (also known as Pduino firmware).;
- N canvas 623 75 404 287 device 0;
- X obj 35 60 inlet;
- X obj 35 118 route open port ports;
- X obj 35 169 tgl 15 0 empty empty open -3 20 0 10 -262144 -1 -1 0
1;
- X floatatom 76 170 5 0 0 3 port - -;
- X obj 117 170 print comport_ports;
- X obj 252 170 outlet;
- X obj 235 74 receive ARDUINO_TEST_RESET;
- X obj 235 97 bang;
- X connect 0 0 1 0;
- X connect 1 0 2 0;
- X connect 1 1 3 0;
- X connect 1 2 4 0;
- X connect 1 3 5 0;
- X connect 6 0 7 0;
- X connect 7 0 5 0;
- X restore 397 295 pd device info;
- N canvas 0 22 450 300 sysex 0;
- X obj 139 19 inlet;
- X obj 127 109 moocow/string2any 32 -1;
- X obj 127 170 print STRING;
- X obj 97 55 list split 1;
- X obj 40 109 print COMMAND;
- X obj 210 54 print sysex;
- X connect 0 0 3 0;
- X connect 0 0 5 0;
- X connect 1 0 2 0;
- X connect 3 0 4 0;
- X connect 3 1 1 0;
- X restore 547 393 pd sysex;
- X text 489 295 <- open to see info;
- X text 371 13 turn on output mode for each pin:;
- N canvas 395 421 446 317 pinMode 0;
- X obj 92 267 outlet;
- X obj 122 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
2 2 -8 0 10 -261682 -1 -1 0;
- X obj 132 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
3 2 -8 0 10 -261682 -1 -1 0;
- X obj 142 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
4 2 -8 0 10 -261682 -1 -1 0;
- X obj 152 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
5 2 -8 0 10 -261682 -1 -1 0;
- X obj 162 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
6 2 -8 0 10 -261682 -1 -1 0;
- X obj 172 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
7 2 -8 0 10 -261682 -1 -1 0;
- X obj 182 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
8 2 -8 0 10 -261682 -1 -1 0;
- X obj 192 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
9 2 -8 0 10 -261682 -1 -1 0;
- X obj 202 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
10 0 -8 0 8 -261682 -1 -1 0;
- X obj 212 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
11 0 -8 0 8 -261682 -1 -1 0;
- X obj 222 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
12 0 -8 0 8 -261682 -1 -1 0;
- X obj 232 100 vradio 10 1 0 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
13 0 -8 0 8 -261682 -1 -1 0;
- X obj 242 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
14 0 -8 0 8 -261682 -1 -1 2;
- X obj 252 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
15 0 -8 0 8 -261682 -1 -1 2;
- X obj 262 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
16 0 -8 0 8 -261682 -1 -1 2;
- X obj 272 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
17 0 -8 0 8 -261682 -1 -1 2;
- X obj 282 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
18 0 -8 0 8 -261682 -1 -1 2;
- X obj 292 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
19 0 -8 0 8 -261682 -1 -1 2;
- X obj 302 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
20 0 -8 0 8 -261682 -1 -1 2;
- X obj 312 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
21 0 -8 0 8 -261682 -1 -1 2;
- N canvas 59 587 1064 355 send-to-arduino---------------------- 0;
- X obj 49 24 inlet;
- X obj 89 24 inlet;
- X obj 128 24 inlet;
- X obj 168 24 inlet;
- X obj 208 24 inlet;
- X obj 248 24 inlet;
- X obj 287 24 inlet;
- X obj 327 24 inlet;
- X obj 368 23 inlet;
- X obj 408 23 inlet;
- X obj 447 23 inlet;
- X obj 487 23 inlet;
- X obj 527 23 inlet;
- X msg 49 66 pinMode 0 \$1;
- X msg 89 88 pinMode 1 \$1;
- X msg 128 110 pinMode 2 \$1;
- X msg 168 130 pinMode 3 \$1;
- X msg 208 62 pinMode 4 \$1;
- X msg 248 84 pinMode 5 \$1;
- X msg 287 106 pinMode 6 \$1;
- X msg 327 126 pinMode 7 \$1;
- X msg 368 58 pinMode 8 \$1;
- X msg 408 80 pinMode 9 \$1;
- X msg 447 102 pinMode 10 \$1;
- X msg 487 122 pinMode 11 \$1;
- X msg 527 50 pinMode 12 \$1;
- X obj 566 23 inlet;
- X msg 566 70 pinMode 13 \$1;
- X obj 481 295 outlet;
- X obj 481 256 trigger bang anything;
- X obj 481 209 list prepend set;
- X obj 481 233 list trim;
- X obj 607 23 inlet;
- X obj 647 23 inlet;
- X obj 687 23 inlet;
- X obj 726 23 inlet;
- X obj 767 23 inlet;
- X obj 807 23 inlet;
- X obj 847 23 inlet;
- X obj 886 23 inlet;
- X msg 607 102 pinMode 14 \$1;
- X msg 647 122 pinMode 15 \$1;
- X msg 687 50 pinMode 16 \$1;
- X msg 726 70 pinMode 17 \$1;
- X msg 767 102 pinMode 18 \$1;
- X msg 807 122 pinMode 19 \$1;
- X msg 847 50 pinMode 20 \$1;
- X msg 886 70 pinMode 21 \$1;
- X obj 927 23 inlet;
- X obj 967 23 inlet;
- X msg 927 102 pinMode 22 \$1;
- X msg 967 122 pinMode 23 \$1;
- X connect 0 0 13 0;
- X connect 1 0 14 0;
- X connect 2 0 15 0;
- X connect 3 0 16 0;
- X connect 4 0 17 0;
- X connect 5 0 18 0;
- X connect 6 0 19 0;
- X connect 7 0 20 0;
- X connect 8 0 21 0;
- X connect 9 0 22 0;
- X connect 10 0 23 0;
- X connect 11 0 24 0;
- X connect 12 0 25 0;
- X connect 13 0 30 0;
- X connect 14 0 30 0;
- X connect 15 0 30 0;
- X connect 16 0 30 0;
- X connect 17 0 30 0;
- X connect 18 0 30 0;
- X connect 19 0 30 0;
- X connect 20 0 30 0;
- X connect 21 0 30 0;
- X connect 22 0 30 0;
- X connect 23 0 30 0;
- X connect 24 0 30 0;
- X connect 25 0 30 0;
- X connect 26 0 27 0;
- X connect 27 0 30 0;
- X connect 29 0 28 0;
- X connect 29 1 28 0;
- X connect 30 0 31 0;
- X connect 31 0 29 0;
- X connect 32 0 40 0;
- X connect 33 0 41 0;
- X connect 34 0 42 0;
- X connect 35 0 43 0;
- X connect 36 0 44 0;
- X connect 37 0 45 0;
- X connect 38 0 46 0;
- X connect 39 0 47 0;
- X connect 40 0 30 0;
- X connect 41 0 30 0;
- X connect 42 0 30 0;
- X connect 43 0 30 0;
- X connect 44 0 30 0;
- X connect 45 0 30 0;
- X connect 46 0 30 0;
- X connect 47 0 30 0;
- X connect 48 0 50 0;
- X connect 49 0 51 0;
- X connect 50 0 30 0;
- X connect 51 0 30 0;
- X restore 94 179 pd send-to-arduino----------------------;
- X obj 322 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
22 0 -8 0 8 -261682 -1 -1 2;
- X obj 332 100 vradio 10 1 1 5 THIS_HIDES_THE_OUTLET THIS_HIDES_THE_INLET
23 0 -8 0 8 -261682 -1 -1 2;
- X obj 100 100 cnv 10 10 50 empty empty Rx 0 23 0 10 -191407 -86277
0;
- X obj 111 100 cnv 10 10 50 empty empty Tx 0 23 0 10 -191407 -13381
0;
- X connect 1 0 21 2;
- X connect 2 0 21 3;
- X connect 3 0 21 4;
- X connect 4 0 21 5;
- X connect 5 0 21 6;
- X connect 6 0 21 7;
- X connect 7 0 21 8;
- X connect 8 0 21 9;
- X connect 9 0 21 10;
- X connect 10 0 21 11;
- X connect 11 0 21 12;
- X connect 12 0 21 13;
- X connect 13 0 21 14;
- X connect 14 0 21 15;
- X connect 15 0 21 16;
- X connect 16 0 21 17;
- X connect 17 0 21 18;
- X connect 18 0 21 19;
- X connect 19 0 21 20;
- X connect 20 0 21 21;
- X connect 21 0 0 0;
- X connect 22 0 21 22;
- X connect 23 0 21 23;
- X coords 0 -1 1 1 242 50 2 100 100;
- X restore 319 60 pd pinMode;
- X text 576 95 servo;
- X text 576 85 pwm;
- X text 576 57 input;
- X text 576 66 output;
- X text 576 76 analog;
- N canvas 66 58 423 503 analog 0;
- X obj 38 10 inlet;
- X obj 131 10 inlet;
- 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 msg 37 308 analog \$1 \$2;
- X connect 0 0 11 0;
- X connect 1 0 10 0;
- X connect 2 0 17 0;
- X connect 3 0 8 0;
- X connect 3 0 2 1;
- X connect 3 1 9 0;
- X connect 3 1 4 1;
- X connect 4 0 17 0;
- X connect 7 0 2 0;
- X connect 7 1 4 0;
- X connect 8 0 7 0;
- X connect 9 0 7 0;
- X connect 10 0 12 0;
- X connect 11 0 7 1;
- X connect 12 0 11 0;
- X connect 12 1 3 0;
- X connect 14 0 13 0;
- X connect 14 1 15 0;
- X connect 15 0 16 0;
- X connect 16 0 13 0;
- X connect 17 0 14 0;
- X restore 31 125 pd analog;
- X text 34 84 (switch pin to PWM or servo first);
- X obj -230 160 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577
0;
- X obj -168 119 hsl 150 17 0 1 0 0 empty ARDUINO_TEST_RESET analog_output_(0-1)
20 9 1 10 -225271 -1 -1 0 0;
- X obj -223 81 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124
-1 -1 0;
- X text -114 67 7;
- X text -221 67 0;
- X text -73 67 10;
- X text -27 67 13;
- X text -162 67 4;
- X text -192 67 2;
- X text -146 67 5;
- X text -131 67 6;
- X text -176 67 3;
- X text -100 67 8;
- X text -83 67 9;
- X text -57 67 11;
- X text -42 67 12;
- X text -206 67 1;
- X msg -222 162 analog 0 0;
- N canvas 66 58 423 503 analog 0;
- X obj 38 10 inlet;
- X obj 131 10 inlet;
- 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 msg 37 308 analog \$1 \$2;
- X connect 0 0 11 0;
- X connect 1 0 10 0;
- X connect 2 0 17 0;
- X connect 3 0 8 0;
- X connect 3 0 2 1;
- X connect 3 1 9 0;
- X connect 3 1 4 1;
- X connect 4 0 17 0;
- X connect 7 0 2 0;
- X connect 7 1 4 0;
- X connect 8 0 7 0;
- X connect 9 0 7 0;
- X connect 10 0 12 0;
- X connect 11 0 7 1;
- X connect 12 0 11 0;
- X connect 12 1 3 0;
- X connect 14 0 13 0;
- X connect 14 1 15 0;
- X connect 15 0 16 0;
- X connect 16 0 13 0;
- X connect 17 0 14 0;
- X restore -222 140 pd analog;
- X text -219 99 (switch pin to PWM or servo first);
- X obj 6 286 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577
0;
- X obj 68 245 hsl 150 17 0 1 0 0 empty ARDUINO_TEST_RESET analog_output_(0-1)
20 9 1 10 -225271 -1 -1 0 0;
- X obj 13 207 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124 -1
-1 0;
- X text 122 193 7;
- X text 15 193 0;
- X text 163 193 10;
- X text 209 193 13;
- X text 74 193 4;
- X text 44 193 2;
- X text 90 193 5;
- X text 105 193 6;
- X text 60 193 3;
- X text 136 193 8;
- X text 153 193 9;
- X text 179 193 11;
- X text 194 193 12;
- X text 30 193 1;
- X msg 14 288 analog 0 0;
- N canvas 66 58 423 503 analog 0;
- X obj 38 10 inlet;
- X obj 131 10 inlet;
- 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 msg 37 308 analog \$1 \$2;
- X connect 0 0 11 0;
- X connect 1 0 10 0;
- X connect 2 0 17 0;
- X connect 3 0 8 0;
- X connect 3 0 2 1;
- X connect 3 1 9 0;
- X connect 3 1 4 1;
- X connect 4 0 17 0;
- X connect 7 0 2 0;
- X connect 7 1 4 0;
- X connect 8 0 7 0;
- X connect 9 0 7 0;
- X connect 10 0 12 0;
- X connect 11 0 7 1;
- X connect 12 0 11 0;
- X connect 12 1 3 0;
- X connect 14 0 13 0;
- X connect 14 1 15 0;
- X connect 15 0 16 0;
- X connect 16 0 13 0;
- X connect 17 0 14 0;
- X restore 14 266 pd analog;
- X text 18 225 (switch pin to PWM or servo first);
- X obj -216 291 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577
0;
- X obj -154 250 hsl 150 17 0 1 0 0 empty ARDUINO_TEST_RESET analog_output_(0-1)
20 9 1 10 -225271 -1 -1 0 0;
- X obj -209 212 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124
-1 -1 0;
- X text -100 198 7;
- X text -207 198 0;
- X text -59 198 10;
- X text -13 198 13;
- X text -148 198 4;
- X text -178 198 2;
- X text -132 198 5;
- X text -117 198 6;
- X text -162 198 3;
- X text -86 198 8;
- X text -69 198 9;
- X text -43 198 11;
- X text -28 198 12;
- X text -192 198 1;
- X msg -208 293 analog 0 0;
- N canvas 66 58 423 503 analog 0;
- X obj 38 10 inlet;
- X obj 131 10 inlet;
- 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 msg 37 308 analog \$1 \$2;
- X connect 0 0 11 0;
- X connect 1 0 10 0;
- X connect 2 0 17 0;
- X connect 3 0 8 0;
- X connect 3 0 2 1;
- X connect 3 1 9 0;
- X connect 3 1 4 1;
- X connect 4 0 17 0;
- X connect 7 0 2 0;
- X connect 7 1 4 0;
- X connect 8 0 7 0;
- X connect 9 0 7 0;
- X connect 10 0 12 0;
- X connect 11 0 7 1;
- X connect 12 0 11 0;
- X connect 12 1 3 0;
- X connect 14 0 13 0;
- X connect 14 1 15 0;
- X connect 15 0 16 0;
- X connect 16 0 13 0;
- X connect 17 0 14 0;
- X restore -208 271 pd analog;
- X text -205 230 (switch pin to PWM or servo first);
- X obj -224 -52 dumpOSC 8000;
- X floatatom -185 4 5 0 0 0 - - -;
- X obj -226 -18 OSCroute /1;
- X obj -195 38 s page-1;
- X obj -106 -141 r page-1;
- X floatatom -106 -63 5 0 0 0 - - -;
- X obj -106 -119 OSCroute /fb /lr;
- X obj -106 -90 moses 0.5;
- X obj -106 -34 * -1;
- X floatatom -106 40 5 0 0 0 - - -;
- X obj -106 -10 + 0.5;
- X obj -106 16 * 2;
- X floatatom -55 -5 5 0 0 0 - - -;
- X obj -55 -59 - 0.5;
- X obj -55 -29 * 2;
- X floatatom 1 -65 5 0 0 0 - - -;
- X obj 1 -92 moses 0.5;
- X obj 1 -36 * -1;
- X floatatom 1 38 5 0 0 0 - - -;
- X obj 1 -12 + 0.5;
- X obj 1 14 * 2;
- X floatatom 52 -7 5 0 0 0 - - -;
- X obj 52 -61 - 0.5;
- X obj 52 -31 * 2;
- X connect 3 0 70 0;
- X connect 4 0 3 0;
- X connect 4 1 6 0;
- X connect 6 0 70 0;
- X connect 7 0 91 1;
- X connect 8 0 37 1;
- X connect 9 0 70 0;
- X connect 10 0 70 0;
- X connect 11 0 10 0;
- X connect 19 0 91 0;
- X connect 34 0 70 0;
- X connect 35 0 70 0;
- X connect 36 0 70 0;
- X connect 37 0 44 0;
- X connect 38 0 70 0;
- X connect 39 0 70 0;
- X connect 40 0 39 0;
- X connect 44 0 45 0;
- X connect 44 1 76 0;
- X connect 45 0 46 0;
- X connect 45 1 46 1;
- X connect 45 2 46 2;
- X connect 45 3 46 3;
- X connect 45 4 46 4;
- X connect 45 5 46 5;
- X connect 45 6 46 6;
- X connect 45 7 46 7;
- X connect 46 0 12 0;
- X connect 46 1 13 0;
- X connect 46 2 14 0;
- X connect 46 3 15 0;
- X connect 46 4 16 0;
- X connect 46 5 17 0;
- X connect 46 6 42 0;
- X connect 46 7 43 0;
- X connect 47 2 48 0;
- X connect 47 3 49 0;
- X connect 47 4 50 0;
- X connect 47 5 51 0;
- X connect 47 6 52 0;
- X connect 47 7 53 0;
- X connect 47 8 54 0;
- X connect 47 9 55 0;
- X connect 47 10 56 0;
- X connect 47 11 57 0;
- X connect 47 12 58 0;
- X connect 47 13 59 0;
- X connect 61 0 71 0;
- X connect 62 0 63 0;
- X connect 62 1 64 0;
- X connect 70 0 37 0;
- X connect 70 1 81 0;
- X connect 72 0 70 0;
- X connect 73 0 70 0;
- X connect 75 0 70 0;
- X connect 76 0 47 0;
- X connect 76 1 62 0;
- X connect 76 2 74 0;
- X connect 76 3 82 0;
- X connect 79 0 9 0;
- X connect 81 0 61 0;
- X connect 85 0 38 0;
- X connect 91 0 34 0;
- X connect 94 0 111 1;
- X connect 95 0 111 0;
- X connect 110 0 70 0;
- X connect 111 0 110 0;
- X connect 114 0 131 1;
- X connect 115 0 131 0;
- X connect 130 0 70 0;
- X connect 131 0 130 0;
- X connect 134 0 151 1;
- X connect 135 0 151 0;
- X connect 150 0 70 0;
- X connect 151 0 150 0;
- X connect 153 0 155 0;
- X connect 155 0 154 0;
- X connect 155 0 156 0;
- X connect 157 0 159 0;
- X connect 158 0 161 0;
- X connect 159 0 160 0;
- X connect 159 1 169 0;
- X connect 160 0 158 0;
- X connect 160 1 166 0;
- X connect 161 0 163 0;
- X connect 162 0 91 1;
- X connect 163 0 164 0;
- X connect 164 0 162 0;
- X connect 165 0 111 1;
- X connect 166 0 167 0;
- X connect 167 0 165 0;
- X connect 168 0 170 0;
- X connect 169 0 168 0;
- X connect 169 1 175 0;
- X connect 170 0 172 0;
- X connect 171 0 131 1;
- X connect 172 0 173 0;
- X connect 173 0 171 0;
- X connect 174 0 151 1;
- X connect 175 0 176 0;
- X connect 176 0 174 0;
Code for Arduino (Standard Firmata)
/*
Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See file LICENSE.txt for further informations on licensing terms.
formatted using the GNU C formatting and indenting
- /
/*
* TODO: use Program Control to load stored profiles from EEPROM */
- include <Firmata.h>
- include <Servo.h>
/*==============================================================================
* GLOBAL VARIABLES *============================================================================*/
/* analog inputs */ int analogInputsToReport = 0; // bitwise array to store pin reporting int analogPin = 0; // counter for reading analog pins
/* digital pins */ byte reportPINs[TOTAL_PORTS]; // PIN == input port byte previousPINs[TOTAL_PORTS]; // PIN == input port byte pinStatus[TOTAL_DIGITAL_PINS]; // store pin status, default OUTPUT byte portStatus[TOTAL_PORTS];
/* timer variables */ unsigned long currentMillis; // store the current value from millis() unsigned long nextExecuteMillis; // for comparison with currentMillis int samplingInterval = 19; // how often to run the main loop (in ms)
Servo servos[MAX_SERVOS];
/*==============================================================================
* FUNCTIONS *============================================================================*/
void outputPort(byte portNumber, byte portValue) {
portValue = portValue &~ portStatus[portNumber]; if(previousPINs[portNumber] != portValue) { Firmata.sendDigitalPort(portNumber, portValue); previousPINs[portNumber] = portValue; Firmata.sendDigitalPort(portNumber, portValue); }
}
/* -----------------------------------------------------------------------------
* 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) {
byte i, tmp; for(i=0; i < TOTAL_PORTS; i++) { if(reportPINs[i]) { switch(i) { case 0: outputPort(0, PIND &~ B00000011); // ignore Rx/Tx 0/1 break; case 1: outputPort(1, PINB); break; case ANALOG_PORT: outputPort(ANALOG_PORT, PINC); break; } } }
}
// ----------------------------------------------------------------------------- /* 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 setPinModeCallback(byte pin, int mode) {
byte port = 0; byte offset = 0;
// TODO: abstract for different boards if (pin < 8) { port = 0; offset = 0; } else if (pin < 14) { port = 1; offset = 8; } else if (pin < 22) { port = 2; offset = 14; } if(pin > 1) { // ignore RxTx (pins 0 and 1) if (isServoSupportedPin(pin) && mode != SERVO) if (servos[pin - FIRST_SERVO_PIN].attached()) servos[pin - FIRST_SERVO_PIN].detach(); if(pin > 13) reportAnalogCallback(pin - 14, mode == ANALOG ? 1 : 0); // turn on/off reporting switch(mode) { case ANALOG: digitalWrite(pin, LOW); // disable internal pull-ups and fall thru to 'case INPUT:' case INPUT: pinStatus[pin] = mode; pinMode(pin, INPUT); portStatus[port] = portStatus[port] &~ (1 << (pin - offset)); break; case OUTPUT: digitalWrite(pin, LOW); // disable PWM and fall thru to 'case PWM:' case PWM: pinStatus[pin] = mode; pinMode(pin, OUTPUT); portStatus[port] = portStatus[port] | (1 << (pin - offset)); break; case SERVO: // TODO: Support Arduino Mega if (isServoSupportedPin(pin)) { pinStatus[pin] = mode; if (!servos[pin - FIRST_SERVO_PIN].attached()) servos[pin - FIRST_SERVO_PIN].attach(pin); } else Firmata.sendString("Servo only on pins from 2 to 13"); break; case I2C: pinStatus[pin] = mode; Firmata.sendString("I2C mode not yet supported"); break; default: Firmata.sendString("Unknown pin mode"); // TODO: put error msgs in EEPROM } // TODO: save status to EEPROM here, if changed }
}
void analogWriteCallback(byte pin, int value) {
switch(pinStatus[pin]) { case SERVO: if (isServoSupportedPin(pin)) servos[pin - FIRST_SERVO_PIN].write(value); break; case PWM: analogWrite(pin, value); break; }
}
void digitalWriteCallback(byte port, int value) {
switch(port) { case 0: // pins 2-7 (don't change Rx/Tx, pins 0 and 1) // 0xFF03 == B1111111100000011 0x03 == B00000011 PORTD = (value &~ 0xFF03) | (PORTD & 0x03); break; case 1: // pins 8-13 (14,15 are disabled for the crystal) PORTB = (byte)value; break; case 2: // analog pins used as digital byte pin; byte pinModeMask; for(pin=0; pin<8; pin++) if(pinStatus[pin] == OUTPUT) pinModeMask += 1 << pin; PORTC = (byte)value & pinModeMask; break; }
}
// ----------------------------------------------------------------------------- /* sets bits in a bit array (int) to toggle the reporting of the analogIns
*/
//void FirmataClass::setAnalogPinReporting(byte pin, byte state) { //} void reportAnalogCallback(byte pin, int value) {
if(value == 0) { analogInputsToReport = analogInputsToReport &~ (1 << pin); } else { // everything but 0 enables reporting of that pin analogInputsToReport = analogInputsToReport | (1 << pin); } // TODO: save status to EEPROM here, if changed
}
void reportDigitalCallback(byte port, int value) {
reportPINs[port] = (byte)value; if(port == ANALOG_PORT) // turn off analog reporting when used as digital analogInputsToReport = 0;
}
/*==============================================================================
* SYSEX-BASED commands *============================================================================*/
void sysexCallback(byte command, byte argc, byte *argv) {
switch(command) { case SERVO_CONFIG: if(argc > 4) { // these vars are here for clarity, they'll optimized away by the compiler byte pin = argv[0]; int minPulse = argv[1] + (argv[2] << 7); int maxPulse = argv[3] + (argv[4] << 7);
if (isServoSupportedPin(pin)) { // servos are pins from 2 to 13, so offset for array if (servos[pin - FIRST_SERVO_PIN].attached()) servos[pin - FIRST_SERVO_PIN].detach(); servos[pin - FIRST_SERVO_PIN].attach(pin, minPulse, maxPulse); setPinModeCallback(pin, SERVO); } } break; case SAMPLING_INTERVAL: if (argc > 1) samplingInterval = argv[0] + (argv[1] << 7); else Firmata.sendString("Not enough data"); break; }
}
boolean isServoSupportedPin(byte pin) {
return ((FIRST_SERVO_PIN <= pin) && (pin <= (FIRST_SERVO_PIN + MAX_SERVOS)));
}
/*==============================================================================
* SETUP() *============================================================================*/
void setup() {
byte i;
Firmata.setFirmwareVersion(2, 1);
Firmata.attach(ANALOG_MESSAGE, analogWriteCallback); Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback); Firmata.attach(REPORT_ANALOG, reportAnalogCallback); Firmata.attach(REPORT_DIGITAL, reportDigitalCallback); Firmata.attach(SET_PIN_MODE, setPinModeCallback); Firmata.attach(START_SYSEX, sysexCallback);
portStatus[0] = B00000011; // ignore Tx/RX pins portStatus[1] = B11000000; // ignore 14/15 pins portStatus[2] = B00000000;
for(i=0; i < FIRST_ANALOG_PIN; ++i) { setPinModeCallback(i,OUTPUT); } // set all outputs to 0 to make sure internal pull-up resistors are off PORTB = 0; // pins 8-15 PORTC = 0; // analog port PORTD = 0; // pins 0-7
// TODO rethink the init, perhaps it should report analog on default for(i=0; i<TOTAL_PORTS; ++i) { reportPINs[i] = false; } // TODO: load state from EEPROM here
/* send digital inputs here, if enabled, to set the initial state on the * host computer, since once in the loop(), this firmware will only send * digital data on change. */ if(reportPINs[0]) outputPort(0, PIND &~ B00000011); // ignore Rx/Tx 0/1 if(reportPINs[1]) outputPort(1, PINB); if(reportPINs[ANALOG_PORT]) outputPort(ANALOG_PORT, PINC);
Firmata.begin(57600);
}
/*==============================================================================
* LOOP() *============================================================================*/
void loop() {
/* DIGITALREAD - as fast as possible, check for changes and output them to the * FTDI buffer using Serial.print() */ checkDigitalInputs(); currentMillis = millis(); if(currentMillis > nextExecuteMillis) { nextExecuteMillis = currentMillis + samplingInterval; /* SERIALREAD - Serial.read() uses a 128 byte circular buffer, so handle * all serialReads at once, i.e. empty the buffer */ while(Firmata.available()) Firmata.processInput(); /* 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( analogInputsToReport & (1 << analogPin) ) { Firmata.sendAnalog(analogPin, analogRead(analogPin)); } } }
}
TouchOSC patch
- CANT UPLOAD ACTUAL FILE*****