Difference between revisions of "User:Hamsammich"

From Robert-Depot
Jump to: navigation, search
 
Line 42: Line 42:
 
[[Image:Trans2.jpg]]
 
[[Image:Trans2.jpg]]
  
[[Image:Ipod.jpg]]
+
[[Image:Control.jpg]]
  
  

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

3469366923_d5f99ec0dd.jpg

________________

Pduino

arduino-test.pd.png

________________

Robot animal

robot-money-box.jpg

________________


FINAL DOCUMENTATION:

Truck.jpg

Remote.jpg

Breadboard.jpg

Trans.jpg

Arduino.jpg

Remote2.jpg

Remote3.jpg

Trans2.jpg

Control.jpg


Code used for Final:

  1. N canvas 331 48 894 684 10;
  2. X obj 313 116 cnv 15 100 22 empty empty empty 20 12 0 14 -253938 -66577

0;

  1. X obj 23 145 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577

0;

  1. X obj 155 170 cnv 15 60 22 empty empty empty 20 12 0 14 -253938 -66577

0;

  1. X msg 161 172 open 2;
  2. N canvas 128 22 525 433 serin 0;
  3. X obj 180 61 cnv 15 15 15 empty \$0-number-canvas 2 4 8 0 14 -233017

-1 0;

  1. X obj 200 225 s \$0-number-canvas;
  2. X obj 60 61 hradio 15 1 1 8 empty empty empty 0 -6 0 8 -225271 -1

-1 2;

  1. X obj 60 13 inlet;
  2. X msg 200 202 label \$1;
  3. X obj 200 180 makefilename %d;
  4. X obj 59 108 int;
  5. X msg 59 206 open \$1;
  6. X obj 59 377 outlet;
  7. X msg 201 306 set \$1 \$2;
  8. X obj 59 266 trigger bang anything;
  9. X obj 201 286 list;
  10. X obj 383 383 outlet;
  11. X obj 384 22 netreceive 34567;
  12. X obj 477 43 tgl 15 0 empty empty empty 0 -6 0 10 -262144 -1 -1 0

1;

  1. X obj 384 41 bng 15 250 50 0 empty empty empty 0 -6 0 10 -262144 -1

-1;

  1. X obj 187 24 delay 15000;
  2. X text 345 379 close;
  3. X text 209 4 for open/close automation in Makefile;
  4. N canvas 698 22 318 215 reset 0;
  5. X obj 65 24 inlet;
  6. X obj 66 58 bang;
  7. X obj 66 150 send ARDUINO_TEST_RESET;
  8. X msg 66 129 0;
  9. X msg 111 99 1;
  10. X obj 111 120 send ARDUINO_PINMODE_RESET;
  11. X connect 0 0 1 0;
  12. X connect 1 0 3 0;
  13. X connect 1 0 4 0;
  14. X connect 3 0 2 0;
  15. X connect 4 0 5 0;
  16. X restore 172 111 pd reset guis;
  17. X connect 2 0 6 0;
  18. X connect 2 0 19 0;
  19. X connect 3 0 2 0;
  20. X connect 4 0 1 0;
  21. X connect 5 0 4 0;
  22. X connect 6 0 5 0;
  23. X connect 6 0 7 0;
  24. X connect 7 0 10 0;
  25. X connect 9 0 8 0;
  26. X connect 10 0 8 0;
  27. X connect 10 1 11 0;
  28. X connect 11 0 9 0;
  29. X connect 13 0 15 0;
  30. X connect 13 1 14 0;
  31. X connect 15 0 16 0;
  32. X connect 15 0 12 0;
  33. X connect 16 0 2 0;
  34. X coords 0 -1 1 1 136 17 1 60 60;
  35. X restore 161 149 pd serin;
  36. X text 158 131 serial port #;
  37. X msg 221 172 close;
  38. 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;

  1. X obj 267 302 tgl 15 1 empty empty empty 0 -6 0 8 -225271 -1 -1 1

1;

  1. X msg 437 220 digitalIns 0 0;
  2. X msg 437 165 analogIns 0 0;
  3. N canvas 162 133 610 460 serin 0;
  4. X obj 59 337 outlet;
  5. X obj 59 266 trigger bang anything;
  6. X obj 201 286 list;
  7. X obj 60 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 0 5 9 1

12 -262130 -1 -1 0 1;

  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;

  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;

  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;

  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;

  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;

  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;

  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;

  1. X msg 59 210 analogIns \$1 \$2;
  2. X msg 35 106 0 \$1;
  3. X msg 70 106 1 \$1;
  4. X msg 105 106 2 \$1;
  5. X msg 140 106 3 \$1;
  6. X msg 175 106 4 \$1;
  7. X msg 210 106 5 \$1;
  8. X msg 245 106 6 \$1;
  9. X msg 280 106 7 \$1;
  10. X msg 202 307 set \$1 \$2 \$3;
  11. X connect 1 0 0 0;
  12. X connect 1 1 2 0;
  13. X connect 2 0 20 0;
  14. X connect 3 0 12 0;
  15. X connect 4 0 13 0;
  16. X connect 5 0 14 0;
  17. X connect 6 0 15 0;
  18. X connect 7 0 16 0;
  19. X connect 8 0 17 0;
  20. X connect 9 0 18 0;
  21. X connect 10 0 19 0;
  22. X connect 11 0 1 0;
  23. X connect 12 0 11 0;
  24. X connect 13 0 11 0;
  25. X connect 14 0 11 0;
  26. X connect 15 0 11 0;
  27. X connect 16 0 11 0;
  28. X connect 17 0 11 0;
  29. X connect 18 0 11 0;
  30. X connect 19 0 11 0;
  31. X connect 20 0 0 0;
  32. X coords 0 -1 1 1 120 16 1 60 60;
  33. X restore 437 145 pd serin;
  34. X floatatom 22 426 5 0 0 3 a0 - -;
  35. X floatatom 68 426 5 0 0 3 a1 - -;
  36. X floatatom 114 426 5 0 0 3 a2 - -;
  37. X floatatom 160 426 5 0 0 3 a3 - -;
  38. X floatatom 206 426 5 0 0 3 a4 - -;
  39. X floatatom 252 426 5 0 0 3 a5 - -;
  40. X text 290 271 <- argument sets port #;
  41. X obj 30 66 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124 -1

-1 0;

  1. X text 139 52 7;
  2. X text 32 52 0;
  3. X text 180 52 10;
  4. X text 226 52 13;
  5. X text 91 52 4;
  6. X text 61 52 2;
  7. X text 107 52 5;
  8. X text 122 52 6;
  9. X text 77 52 3;
  10. X text 153 52 8;
  11. X text 170 52 9;
  12. X text 196 52 11;
  13. X text 211 52 12;
  14. X text 47 52 1;
  15. X msg 31 147 analog 0 0;
  16. X msg 319 155 info;
  17. X msg 358 155 version;
  18. X obj 220 302 spigot;
  19. X msg 319 118 pinMode 23 2;
  20. N canvas 67 22 475 478 sending 0;
  21. X obj 69 228 cnv 15 100 22 empty empty empty 20 12 0 14 -253938 -66577

0;

  1. X obj 78 434 outlet;
  2. X msg 78 231 digital 22 0;
  3. X obj 127 148 tgl 15 0 empty empty 7 4 -6 1 12 -233017 -1 -1 0 1;
  4. X obj 144 148 tgl 15 0 empty empty 8 4 -6 1 12 -233017 -1 -1 0 1;
  5. X obj 161 148 tgl 15 0 empty empty 9 4 -6 1 12 -233017 -1 -1 0 1;
  6. X obj 178 148 tgl 15 0 empty empty 10 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 195 148 tgl 15 0 empty empty 11 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 212 148 tgl 15 0 empty empty 12 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 229 148 tgl 15 0 empty empty 13 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 42 148 tgl 15 0 empty empty 2 4 -6 1 12 -233017 -1 -1 0 1;
  2. X obj 59 148 tgl 15 0 empty empty 3 4 -6 1 12 -233017 -1 -1 0 1;
  3. X obj 76 148 tgl 15 0 empty empty 4 4 -6 1 12 -233017 -1 -1 0 1;
  4. X obj 93 148 tgl 15 0 empty empty 5 4 -6 1 12 -233017 -1 -1 0 1;
  5. X obj 110 148 tgl 15 0 empty empty 6 4 -6 1 12 -233017 -1 -1 0 1;
  6. X obj 418 123 tgl 25 0 empty ARDUINO_TEST_RESET ALL 2 12 0 12 -262144

-1 -1 0 1;

  1. X obj 388 72 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 16383
  1. X obj 388 92 metro 100;
  2. X obj 301 9 inlet;
  3. X obj 8 148 tgl 15 0 empty empty 0 3 -6 1 12 -260818 -1 -1 0 1;
  4. X obj 25 148 tgl 15 0 empty empty 1 3 -6 1 12 -260818 -1 -1 0 1;
  5. X obj 8 148 cnv 15 15 15 empty empty Rx 1 10 0 11 -128992 -86277 0
  1. X obj 25 148 cnv 15 15 15 empty empty Tx 1 10 0 11 -128992 -13381

0;

  1. X obj 301 43 trigger 0 float;
  2. X obj 301 64 select 0;
  3. X msg 301 84 0;
  4. X msg 405 389 port 1 0;
  5. X msg 263 389 port 0 0;
  6. X msg 189 389 port 0 255;
  7. X msg 331 389 port 1 255;
  8. X text 95 291 or send 8-bit ports in one message:;
  9. X msg 159 338 port 1 \$1;
  10. X msg 91 338 port 0 \$1;
  11. X msg 230 338 port 2 \$1;
  12. X obj 362 297 tgl 25 0 empty ARDUINO_TEST_RESET ALL 2 12 0 12 -262144

-1 -1 0 255;

  1. X obj 362 246 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0

16383;

  1. X obj 362 266 metro 100;
  2. X floatatom 362 329 5 0 0 0 - - -;
  3. X obj 246 148 tgl 15 0 empty empty 14 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 263 148 tgl 15 0 empty empty 15 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 280 148 tgl 15 0 empty empty 16 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 297 148 tgl 15 0 empty empty 17 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 314 148 tgl 15 0 empty empty 18 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 331 148 tgl 15 0 empty empty 19 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 348 148 tgl 15 0 empty empty 20 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 365 148 tgl 15 0 empty empty 21 0 -6 1 12 -233017 -1 -1 0 1
  1. N canvas 314 233 1035 340 generate 0;
  2. X obj 12 24 inlet;
  3. X obj 52 24 inlet;
  4. X obj 91 24 inlet;
  5. X obj 131 24 inlet;
  6. X obj 171 24 inlet;
  7. X obj 211 24 inlet;
  8. X obj 250 24 inlet;
  9. X obj 290 24 inlet;
  10. X obj 331 23 inlet;
  11. X obj 371 23 inlet;
  12. X obj 410 23 inlet;
  13. X obj 450 23 inlet;
  14. X obj 490 23 inlet;
  15. X msg 12 66 digital 0 \$1;
  16. X msg 52 88 digital 1 \$1;
  17. X msg 91 110 digital 2 \$1;
  18. X msg 131 130 digital 3 \$1;
  19. X msg 171 62 digital 4 \$1;
  20. X msg 211 84 digital 5 \$1;
  21. X msg 250 106 digital 6 \$1;
  22. X msg 290 126 digital 7 \$1;
  23. X msg 331 58 digital 8 \$1;
  24. X msg 371 80 digital 9 \$1;
  25. X msg 410 102 digital 10 \$1;
  26. X msg 450 122 digital 11 \$1;
  27. X msg 490 50 digital 12 \$1;
  28. X obj 529 23 inlet;
  29. X msg 529 70 digital 13 \$1;
  30. X obj 513 302 outlet;
  31. X obj 513 263 trigger bang anything;
  32. X obj 513 214 list prepend set;
  33. X obj 513 238 list trim;
  34. X obj 570 23 inlet;
  35. X obj 610 23 inlet;
  36. X obj 650 23 inlet;
  37. X obj 689 23 inlet;
  38. X msg 570 102 digital 14 \$1;
  39. X msg 610 122 digital 15 \$1;
  40. X msg 650 50 digital 16 \$1;
  41. X msg 689 70 digital 17 \$1;
  42. X obj 730 23 inlet;
  43. X obj 770 23 inlet;
  44. X obj 810 23 inlet;
  45. X obj 849 23 inlet;
  46. X msg 730 102 digital 18 \$1;
  47. X msg 770 122 digital 19 \$1;
  48. X msg 810 50 digital 20 \$1;
  49. X msg 849 70 digital 21 \$1;
  50. X obj 890 23 inlet;
  51. X obj 930 23 inlet;
  52. X msg 890 102 digital 22 \$1;
  53. X msg 930 122 digital 23 \$1;
  54. X connect 0 0 13 0;
  55. X connect 1 0 14 0;
  56. X connect 2 0 15 0;
  57. X connect 3 0 16 0;
  58. X connect 4 0 17 0;
  59. X connect 5 0 18 0;
  60. X connect 6 0 19 0;
  61. X connect 7 0 20 0;
  62. X connect 8 0 21 0;
  63. X connect 9 0 22 0;
  64. X connect 10 0 23 0;
  65. X connect 11 0 24 0;
  66. X connect 12 0 25 0;
  67. X connect 13 0 30 0;
  68. X connect 14 0 30 0;
  69. X connect 15 0 30 0;
  70. X connect 16 0 30 0;
  71. X connect 17 0 30 0;
  72. X connect 18 0 30 0;
  73. X connect 19 0 30 0;
  74. X connect 20 0 30 0;
  75. X connect 21 0 30 0;
  76. X connect 22 0 30 0;
  77. X connect 23 0 30 0;
  78. X connect 24 0 30 0;
  79. X connect 25 0 30 0;
  80. X connect 26 0 27 0;
  81. X connect 27 0 30 0;
  82. X connect 29 0 28 0;
  83. X connect 29 1 28 0;
  84. X connect 30 0 31 0;
  85. X connect 31 0 29 0;
  86. X connect 32 0 36 0;
  87. X connect 33 0 37 0;
  88. X connect 34 0 38 0;
  89. X connect 35 0 39 0;
  90. X connect 36 0 30 0;
  91. X connect 37 0 30 0;
  92. X connect 38 0 30 0;
  93. X connect 39 0 30 0;
  94. X connect 40 0 44 0;
  95. X connect 41 0 45 0;
  96. X connect 42 0 46 0;
  97. X connect 43 0 47 0;
  98. X connect 44 0 30 0;
  99. X connect 45 0 30 0;
  100. X connect 46 0 30 0;
  101. X connect 47 0 30 0;
  102. X connect 48 0 50 0;
  103. X connect 49 0 51 0;
  104. X connect 50 0 30 0;
  105. X connect 51 0 30 0;
  106. X restore 78 201 pd generate digital out messages ------------------
  1. X obj 382 148 tgl 15 0 empty empty 22 0 -6 1 12 -233017 -1 -1 0 1
  1. X obj 399 148 tgl 15 0 empty empty 23 0 -6 1 12 -233017 -1 -1 0 1
  1. X connect 2 0 1 0;
  2. X connect 3 0 46 7;
  3. X connect 4 0 46 8;
  4. X connect 5 0 46 9;
  5. X connect 6 0 46 10;
  6. X connect 7 0 46 11;
  7. X connect 8 0 46 12;
  8. X connect 9 0 46 13;
  9. X connect 10 0 46 2;
  10. X connect 11 0 46 3;
  11. X connect 12 0 46 4;
  12. X connect 13 0 46 5;
  13. X connect 14 0 46 6;
  14. X connect 15 0 9 0;
  15. X connect 15 0 8 0;
  16. X connect 15 0 7 0;
  17. X connect 15 0 6 0;
  18. X connect 15 0 5 0;
  19. X connect 15 0 4 0;
  20. X connect 15 0 3 0;
  21. X connect 15 0 14 0;
  22. X connect 15 0 13 0;
  23. X connect 15 0 12 0;
  24. X connect 15 0 11 0;
  25. X connect 15 0 10 0;
  26. X connect 15 0 43 0;
  27. X connect 15 0 44 0;
  28. X connect 15 0 45 0;
  29. X connect 15 0 42 0;
  30. X connect 15 0 41 0;
  31. X connect 15 0 40 0;
  32. X connect 15 0 39 0;
  33. X connect 15 0 38 0;
  34. X connect 15 0 48 0;
  35. X connect 15 0 47 0;
  36. X connect 16 0 17 0;
  37. X connect 17 0 15 0;
  38. X connect 18 0 23 0;
  39. X connect 23 0 24 0;
  40. X connect 23 1 16 0;
  41. X connect 24 0 25 0;
  42. X connect 25 0 15 0;
  43. X connect 26 0 1 0;
  44. X connect 27 0 1 0;
  45. X connect 28 0 1 0;
  46. X connect 29 0 1 0;
  47. X connect 31 0 1 0;
  48. X connect 32 0 1 0;
  49. X connect 33 0 1 0;
  50. X connect 34 0 37 0;
  51. X connect 34 0 33 0;
  52. X connect 34 0 31 0;
  53. X connect 34 0 32 0;
  54. X connect 35 0 36 0;
  55. X connect 36 0 34 0;
  56. X connect 38 0 46 14;
  57. X connect 39 0 46 15;
  58. X connect 40 0 46 16;
  59. X connect 41 0 46 17;
  60. X connect 42 0 46 18;
  61. X connect 43 0 46 19;
  62. X connect 44 0 46 20;
  63. X connect 45 0 46 21;
  64. X connect 46 0 2 0;
  65. X connect 47 0 46 22;
  66. X connect 48 0 46 23;
  67. X restore -40 355 pd sending digital outs;
  68. X obj -39 331 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0

16383;

  1. X text -16 329 pulse all outputs;
  2. X floatatom 298 426 5 0 0 3 a6 - -;
  3. X floatatom 344 426 5 0 0 3 a7 - -;
  4. X obj 220 324 route analog;
  5. X obj 121 369 route 0 1 2 3 4 5 6 7;
  6. N canvas 978 22 499 396 display 0;
  7. X obj 6 7 inlet;
  8. X obj 6 28 mapping/resample 100;
  9. X obj 6 50 outlet;
  10. X obj 54 50 inlet;
  11. X obj 54 71 mapping/resample 100;
  12. X obj 54 93 outlet;
  13. X obj 103 93 inlet;
  14. X obj 103 114 mapping/resample 100;
  15. X obj 103 136 outlet;
  16. X obj 151 136 inlet;
  17. X obj 151 157 mapping/resample 100;
  18. X obj 151 179 outlet;
  19. X obj 200 179 inlet;
  20. X obj 200 200 mapping/resample 100;
  21. X obj 200 222 outlet;
  22. X obj 247 222 inlet;
  23. X obj 247 243 mapping/resample 100;
  24. X obj 247 265 outlet;
  25. X obj 295 265 inlet;
  26. X obj 295 286 mapping/resample 100;
  27. X obj 295 308 outlet;
  28. X obj 345 308 inlet;
  29. X obj 345 329 mapping/resample 100;
  30. X obj 345 351 outlet;
  31. X obj 60 290 receive ARDUINO_TEST_RESET;
  32. X connect 0 0 1 0;
  33. X connect 1 0 2 0;
  34. X connect 3 0 4 0;
  35. X connect 4 0 5 0;
  36. X connect 6 0 7 0;
  37. X connect 7 0 8 0;
  38. X connect 9 0 10 0;
  39. X connect 10 0 11 0;
  40. X connect 12 0 13 0;
  41. X connect 13 0 14 0;
  42. X connect 15 0 16 0;
  43. X connect 16 0 17 0;
  44. X connect 18 0 19 0;
  45. X connect 19 0 20 0;
  46. X connect 21 0 22 0;
  47. X connect 22 0 23 0;
  48. X connect 24 0 22 0;
  49. X connect 24 0 19 0;
  50. X connect 24 0 16 0;
  51. X connect 24 0 13 0;
  52. X connect 24 0 10 0;
  53. X connect 24 0 7 0;
  54. X connect 24 0 4 0;
  55. X connect 24 0 1 0;
  56. X restore 45 400 pd display values without pegging the CPU;
  57. X obj 397 433 route 0 1 2 3 4 5 6 7 8 9 10 11 12 13;
  58. X obj 428 455 tgl 15 0 empty ARDUINO_TEST_RESET 2 4 23 1 12 -232448

-1 -1 0 1;

  1. X obj 445 455 tgl 15 0 empty ARDUINO_TEST_RESET 3 4 23 1 12 -232448

-1 -1 0 1;

  1. X obj 462 455 tgl 15 0 empty ARDUINO_TEST_RESET 4 4 23 1 12 -232448

-1 -1 0 1;

  1. X obj 479 455 tgl 15 0 empty ARDUINO_TEST_RESET 5 4 23 1 12 -232448

-1 -1 0 1;

  1. X obj 496 455 tgl 15 0 empty ARDUINO_TEST_RESET 6 4 23 1 12 -232448

-1 -1 0 1;

  1. X obj 513 455 tgl 15 0 empty ARDUINO_TEST_RESET 7 4 23 1 12 -232448

-1 -1 0 1;

  1. X obj 530 455 tgl 15 0 empty ARDUINO_TEST_RESET 8 4 23 1 12 -232448

-1 -1 0 1;

  1. X obj 547 455 tgl 15 0 empty ARDUINO_TEST_RESET 9 4 23 1 12 -232448

-1 -1 0 1;

  1. X obj 564 455 tgl 15 0 empty ARDUINO_TEST_RESET 10 0 23 1 12 -232448

-1 -1 0 1;

  1. X obj 581 455 tgl 15 0 empty ARDUINO_TEST_RESET 11 0 23 1 12 -232448

-1 -1 0 1;

  1. X obj 598 455 tgl 15 0 empty ARDUINO_TEST_RESET 12 0 23 1 12 -232448

-1 -1 0 1;

  1. X obj 615 455 tgl 15 0 empty ARDUINO_TEST_RESET 13 0 23 1 12 -232448

-1 -1 0 1;

  1. X text 2 484 (C) Copyright 2006 Free Software Foundation;
  2. N canvas 0 22 451 224 ver 0;
  3. X obj 23 7 inlet;
  4. X obj 250 100 cnv 15 145 17 empty \$0-version_cnv empty 4 10 0 12

-203904 -1 0;

  1. X obj 23 157 send \$0-version_cnv;
  2. X msg 23 132 label \$1;
  3. X obj 48 103 symbol;
  4. X obj 38 77 loadbang;
  5. X msg 96 78 bang;
  6. X obj 309 163 outlet;
  7. X obj 23 52 zexy/makesymbol Firmata-%s.%s;
  8. X obj 23 29 route version bang;
  9. X connect 0 0 9 0;
  10. X connect 3 0 2 0;
  11. X connect 4 0 3 0;
  12. X connect 5 0 4 0;
  13. X connect 6 0 4 0;
  14. X connect 8 0 3 0;
  15. X connect 9 0 8 0;
  16. X connect 9 1 7 0;
  17. X connect 9 1 6 0;
  18. X connect 9 2 7 0;
  19. X coords 0 -1 1 1 145 17 1 250 100;
  20. X restore 397 317 pd ver;
  21. X obj 414 393 unpack 0 0;
  22. X floatatom 414 413 5 0 0 0 - - -;
  23. X floatatom 471 413 5 0 0 0 - - -;
  24. X obj 394 455 tgl 15 0 empty empty 0 4 23 1 12 -232448 -1 -1 0 1;
  25. X obj 411 455 tgl 15 0 empty empty 1 4 23 1 12 -232448 -1 -1 0 1;
  26. X obj 394 455 cnv 15 15 15 empty empty Rx 1 10 0 11 -128992 -86277

0;

  1. X obj 411 455 cnv 15 15 15 empty empty Tx 1 10 0 11 -128992 -13381

0;

  1. X text 436 128 which analogIns to enable:;
  2. X obj 220 272 arduino 1;
  3. N canvas 649 518 411 212 firmware 0;
  4. X obj 123 2 inlet;
  5. X obj 250 100 cnv 15 145 17 empty \$0-firmware_cnv empty 4 10 0 12

-232576 -66577 0;

  1. X msg 123 156 label \$1;
  2. X obj 148 127 symbol;
  3. X obj 138 101 loadbang;
  4. X msg 196 102 bang;
  5. X obj 123 181 send \$0-firmware_cnv;
  6. X obj 123 24 route firmware;
  7. X obj 18 181 print Firmware;
  8. X obj 123 49 list;
  9. X obj 123 80 zexy/makesymbol %s-%s.%s;
  10. X obj 18 151 list trim;
  11. X obj 204 45 route bang;
  12. X connect 0 0 7 0;
  13. X connect 2 0 6 0;
  14. X connect 3 0 2 0;
  15. X connect 4 0 3 0;
  16. X connect 5 0 3 0;
  17. X connect 7 0 9 0;
  18. X connect 7 1 12 0;
  19. X connect 9 0 10 0;
  20. X connect 10 0 2 0;
  21. X connect 10 0 11 0;
  22. X connect 11 0 8 0;
  23. X connect 12 0 5 0;
  24. X coords 0 -1 1 1 145 17 1 250 100;
  25. X restore 397 337 pd firmware;
  26. X msg 358 195 devices;
  27. X msg 358 175 firmware;
  28. N canvas 0 22 450 300 STRING 0;
  29. X obj 48 13 inlet;
  30. X obj 51 93 moocow/string2any 32 -1;
  31. X obj 51 154 print STRING;
  32. X connect 0 0 1 0;
  33. X connect 1 0 2 0;
  34. X restore 482 393 pd STRING;
  35. N canvas 205 22 593 390 strings 0;
  36. X obj -178 287 outlet;
  37. X obj -142 101 moocow/any2string;
  38. X symbolatom -92 48 10 0 0 0 - - -;
  39. X obj -119 179 pddp/print;
  40. X obj -92 68 list trim;
  41. X msg -175 39 test;
  42. X msg -139 40 TEST;
  43. X obj -142 130 cyclone/prepend string;
  44. X obj -313 102 moocow/any2string;
  45. X symbolatom -263 49 10 0 0 0 - - -;
  46. X obj -314 202 pddp/print;
  47. X obj -263 69 list trim;
  48. X msg -346 40 test;
  49. X msg -310 41 TEST;
  50. X obj -313 153 cyclone/prepend sysex;
  51. X obj -313 131 cyclone/prepend 40;
  52. X msg 66 117 samplingInterval \$1;
  53. X obj 69 93 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144

-1 -1 0 1;

  1. X floatatom 27 117 5 0 0 0 - - -;
  2. X connect 1 0 7 0;
  3. X connect 2 0 4 0;
  4. X connect 4 0 1 0;
  5. X connect 5 0 1 0;
  6. X connect 6 0 1 0;
  7. X connect 7 0 3 0;
  8. X connect 7 0 0 0;
  9. X connect 8 0 15 0;
  10. X connect 9 0 11 0;
  11. X connect 11 0 8 0;
  12. X connect 12 0 8 0;
  13. X connect 13 0 8 0;
  14. X connect 14 0 0 0;
  15. X connect 14 0 10 0;
  16. X connect 15 0 14 0;
  17. X connect 16 0 0 0;
  18. X connect 17 0 16 0;
  19. X connect 17 0 18 0;
  20. X restore 437 242 pd strings and special messages;
  21. X obj 397 369 route digital version string sysex;
  22. X text 397 483 released under the GNU GPL v2 or later;
  23. X text 436 183 which digital ports to enable:;
  24. N canvas 162 133 610 460 seri 0;
  25. X obj 59 337 outlet;
  26. X obj 59 266 trigger bang anything;
  27. X obj 201 286 list;
  28. X obj 60 61 tgl 15 0 junk_to_hide_inlet ARDUINO_TEST_RESET 0 5 9 1

12 -260736 -1 -1 0 1;

  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;

  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;

  1. X msg 35 106 0 \$1;
  2. X msg 70 106 1 \$1;
  3. X msg 105 106 2 \$1;
  4. X msg 202 307 set \$1 \$2 \$3;
  5. X msg 59 210 digitalIns \$1 \$2;
  6. X connect 1 0 0 0;
  7. X connect 1 1 2 0;
  8. X connect 2 0 9 0;
  9. X connect 3 0 6 0;
  10. X connect 4 0 7 0;
  11. X connect 5 0 8 0;
  12. X connect 6 0 10 0;
  13. X connect 7 0 10 0;
  14. X connect 8 0 10 0;
  15. X connect 9 0 0 0;
  16. X connect 10 0 1 0;
  17. X coords 0 -1 1 1 45 16 1 60 60;
  18. X restore 437 200 pd seri;
  19. X text 13 6 The [arduino] object works with the Firmata firmware for

Arduino (also known as Pduino firmware).;

  1. N canvas 623 75 404 287 device 0;
  2. X obj 35 60 inlet;
  3. X obj 35 118 route open port ports;
  4. X obj 35 169 tgl 15 0 empty empty open -3 20 0 10 -262144 -1 -1 0

1;

  1. X floatatom 76 170 5 0 0 3 port - -;
  2. X obj 117 170 print comport_ports;
  3. X obj 252 170 outlet;
  4. X obj 235 74 receive ARDUINO_TEST_RESET;
  5. X obj 235 97 bang;
  6. X connect 0 0 1 0;
  7. X connect 1 0 2 0;
  8. X connect 1 1 3 0;
  9. X connect 1 2 4 0;
  10. X connect 1 3 5 0;
  11. X connect 6 0 7 0;
  12. X connect 7 0 5 0;
  13. X restore 397 295 pd device info;
  14. N canvas 0 22 450 300 sysex 0;
  15. X obj 139 19 inlet;
  16. X obj 127 109 moocow/string2any 32 -1;
  17. X obj 127 170 print STRING;
  18. X obj 97 55 list split 1;
  19. X obj 40 109 print COMMAND;
  20. X obj 210 54 print sysex;
  21. X connect 0 0 3 0;
  22. X connect 0 0 5 0;
  23. X connect 1 0 2 0;
  24. X connect 3 0 4 0;
  25. X connect 3 1 1 0;
  26. X restore 547 393 pd sysex;
  27. X text 489 295 <- open to see info;
  28. X text 371 13 turn on output mode for each pin:;
  29. N canvas 395 421 446 317 pinMode 0;
  30. X obj 92 267 outlet;
  31. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. 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;

  1. N canvas 59 587 1064 355 send-to-arduino---------------------- 0;
  2. X obj 49 24 inlet;
  3. X obj 89 24 inlet;
  4. X obj 128 24 inlet;
  5. X obj 168 24 inlet;
  6. X obj 208 24 inlet;
  7. X obj 248 24 inlet;
  8. X obj 287 24 inlet;
  9. X obj 327 24 inlet;
  10. X obj 368 23 inlet;
  11. X obj 408 23 inlet;
  12. X obj 447 23 inlet;
  13. X obj 487 23 inlet;
  14. X obj 527 23 inlet;
  15. X msg 49 66 pinMode 0 \$1;
  16. X msg 89 88 pinMode 1 \$1;
  17. X msg 128 110 pinMode 2 \$1;
  18. X msg 168 130 pinMode 3 \$1;
  19. X msg 208 62 pinMode 4 \$1;
  20. X msg 248 84 pinMode 5 \$1;
  21. X msg 287 106 pinMode 6 \$1;
  22. X msg 327 126 pinMode 7 \$1;
  23. X msg 368 58 pinMode 8 \$1;
  24. X msg 408 80 pinMode 9 \$1;
  25. X msg 447 102 pinMode 10 \$1;
  26. X msg 487 122 pinMode 11 \$1;
  27. X msg 527 50 pinMode 12 \$1;
  28. X obj 566 23 inlet;
  29. X msg 566 70 pinMode 13 \$1;
  30. X obj 481 295 outlet;
  31. X obj 481 256 trigger bang anything;
  32. X obj 481 209 list prepend set;
  33. X obj 481 233 list trim;
  34. X obj 607 23 inlet;
  35. X obj 647 23 inlet;
  36. X obj 687 23 inlet;
  37. X obj 726 23 inlet;
  38. X obj 767 23 inlet;
  39. X obj 807 23 inlet;
  40. X obj 847 23 inlet;
  41. X obj 886 23 inlet;
  42. X msg 607 102 pinMode 14 \$1;
  43. X msg 647 122 pinMode 15 \$1;
  44. X msg 687 50 pinMode 16 \$1;
  45. X msg 726 70 pinMode 17 \$1;
  46. X msg 767 102 pinMode 18 \$1;
  47. X msg 807 122 pinMode 19 \$1;
  48. X msg 847 50 pinMode 20 \$1;
  49. X msg 886 70 pinMode 21 \$1;
  50. X obj 927 23 inlet;
  51. X obj 967 23 inlet;
  52. X msg 927 102 pinMode 22 \$1;
  53. X msg 967 122 pinMode 23 \$1;
  54. X connect 0 0 13 0;
  55. X connect 1 0 14 0;
  56. X connect 2 0 15 0;
  57. X connect 3 0 16 0;
  58. X connect 4 0 17 0;
  59. X connect 5 0 18 0;
  60. X connect 6 0 19 0;
  61. X connect 7 0 20 0;
  62. X connect 8 0 21 0;
  63. X connect 9 0 22 0;
  64. X connect 10 0 23 0;
  65. X connect 11 0 24 0;
  66. X connect 12 0 25 0;
  67. X connect 13 0 30 0;
  68. X connect 14 0 30 0;
  69. X connect 15 0 30 0;
  70. X connect 16 0 30 0;
  71. X connect 17 0 30 0;
  72. X connect 18 0 30 0;
  73. X connect 19 0 30 0;
  74. X connect 20 0 30 0;
  75. X connect 21 0 30 0;
  76. X connect 22 0 30 0;
  77. X connect 23 0 30 0;
  78. X connect 24 0 30 0;
  79. X connect 25 0 30 0;
  80. X connect 26 0 27 0;
  81. X connect 27 0 30 0;
  82. X connect 29 0 28 0;
  83. X connect 29 1 28 0;
  84. X connect 30 0 31 0;
  85. X connect 31 0 29 0;
  86. X connect 32 0 40 0;
  87. X connect 33 0 41 0;
  88. X connect 34 0 42 0;
  89. X connect 35 0 43 0;
  90. X connect 36 0 44 0;
  91. X connect 37 0 45 0;
  92. X connect 38 0 46 0;
  93. X connect 39 0 47 0;
  94. X connect 40 0 30 0;
  95. X connect 41 0 30 0;
  96. X connect 42 0 30 0;
  97. X connect 43 0 30 0;
  98. X connect 44 0 30 0;
  99. X connect 45 0 30 0;
  100. X connect 46 0 30 0;
  101. X connect 47 0 30 0;
  102. X connect 48 0 50 0;
  103. X connect 49 0 51 0;
  104. X connect 50 0 30 0;
  105. X connect 51 0 30 0;
  106. X restore 94 179 pd send-to-arduino----------------------;
  107. 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;

  1. 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;

  1. X obj 100 100 cnv 10 10 50 empty empty Rx 0 23 0 10 -191407 -86277

0;

  1. X obj 111 100 cnv 10 10 50 empty empty Tx 0 23 0 10 -191407 -13381

0;

  1. X connect 1 0 21 2;
  2. X connect 2 0 21 3;
  3. X connect 3 0 21 4;
  4. X connect 4 0 21 5;
  5. X connect 5 0 21 6;
  6. X connect 6 0 21 7;
  7. X connect 7 0 21 8;
  8. X connect 8 0 21 9;
  9. X connect 9 0 21 10;
  10. X connect 10 0 21 11;
  11. X connect 11 0 21 12;
  12. X connect 12 0 21 13;
  13. X connect 13 0 21 14;
  14. X connect 14 0 21 15;
  15. X connect 15 0 21 16;
  16. X connect 16 0 21 17;
  17. X connect 17 0 21 18;
  18. X connect 18 0 21 19;
  19. X connect 19 0 21 20;
  20. X connect 20 0 21 21;
  21. X connect 21 0 0 0;
  22. X connect 22 0 21 22;
  23. X connect 23 0 21 23;
  24. X coords 0 -1 1 1 242 50 2 100 100;
  25. X restore 319 60 pd pinMode;
  26. X text 576 95 servo;
  27. X text 576 85 pwm;
  28. X text 576 57 input;
  29. X text 576 66 output;
  30. X text 576 76 analog;
  31. N canvas 66 58 423 503 analog 0;
  32. X obj 38 10 inlet;
  33. X obj 131 10 inlet;
  34. X obj 38 259 pack float float;
  35. X obj 192 113 route float symbol;
  36. X obj 188 259 pack float symbol;
  37. X text 78 11 pin#;
  38. X text 179 10 PWM value or "off";
  39. X obj 39 217 cyclone/gate 2;
  40. X msg 191 153 1;
  41. X msg 252 153 2;
  42. X obj 131 34 list;
  43. X obj 131 113 float;
  44. X obj 131 67 trigger bang anything;
  45. X obj 37 427 outlet;
  46. X obj 37 356 trigger bang anything;
  47. X obj 179 376 list;
  48. X msg 179 396 set \$1 \$2 \$3;
  49. X msg 37 308 analog \$1 \$2;
  50. X connect 0 0 11 0;
  51. X connect 1 0 10 0;
  52. X connect 2 0 17 0;
  53. X connect 3 0 8 0;
  54. X connect 3 0 2 1;
  55. X connect 3 1 9 0;
  56. X connect 3 1 4 1;
  57. X connect 4 0 17 0;
  58. X connect 7 0 2 0;
  59. X connect 7 1 4 0;
  60. X connect 8 0 7 0;
  61. X connect 9 0 7 0;
  62. X connect 10 0 12 0;
  63. X connect 11 0 7 1;
  64. X connect 12 0 11 0;
  65. X connect 12 1 3 0;
  66. X connect 14 0 13 0;
  67. X connect 14 1 15 0;
  68. X connect 15 0 16 0;
  69. X connect 16 0 13 0;
  70. X connect 17 0 14 0;
  71. X restore 31 125 pd analog;
  72. X text 34 84 (switch pin to PWM or servo first);
  73. X obj -230 160 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577

0;

  1. 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;

  1. X obj -223 81 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124

-1 -1 0;

  1. X text -114 67 7;
  2. X text -221 67 0;
  3. X text -73 67 10;
  4. X text -27 67 13;
  5. X text -162 67 4;
  6. X text -192 67 2;
  7. X text -146 67 5;
  8. X text -131 67 6;
  9. X text -176 67 3;
  10. X text -100 67 8;
  11. X text -83 67 9;
  12. X text -57 67 11;
  13. X text -42 67 12;
  14. X text -206 67 1;
  15. X msg -222 162 analog 0 0;
  16. N canvas 66 58 423 503 analog 0;
  17. X obj 38 10 inlet;
  18. X obj 131 10 inlet;
  19. X obj 38 259 pack float float;
  20. X obj 192 113 route float symbol;
  21. X obj 188 259 pack float symbol;
  22. X text 78 11 pin#;
  23. X text 179 10 PWM value or "off";
  24. X obj 39 217 cyclone/gate 2;
  25. X msg 191 153 1;
  26. X msg 252 153 2;
  27. X obj 131 34 list;
  28. X obj 131 113 float;
  29. X obj 131 67 trigger bang anything;
  30. X obj 37 427 outlet;
  31. X obj 37 356 trigger bang anything;
  32. X obj 179 376 list;
  33. X msg 179 396 set \$1 \$2 \$3;
  34. X msg 37 308 analog \$1 \$2;
  35. X connect 0 0 11 0;
  36. X connect 1 0 10 0;
  37. X connect 2 0 17 0;
  38. X connect 3 0 8 0;
  39. X connect 3 0 2 1;
  40. X connect 3 1 9 0;
  41. X connect 3 1 4 1;
  42. X connect 4 0 17 0;
  43. X connect 7 0 2 0;
  44. X connect 7 1 4 0;
  45. X connect 8 0 7 0;
  46. X connect 9 0 7 0;
  47. X connect 10 0 12 0;
  48. X connect 11 0 7 1;
  49. X connect 12 0 11 0;
  50. X connect 12 1 3 0;
  51. X connect 14 0 13 0;
  52. X connect 14 1 15 0;
  53. X connect 15 0 16 0;
  54. X connect 16 0 13 0;
  55. X connect 17 0 14 0;
  56. X restore -222 140 pd analog;
  57. X text -219 99 (switch pin to PWM or servo first);
  58. X obj 6 286 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577

0;

  1. 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;

  1. X obj 13 207 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124 -1

-1 0;

  1. X text 122 193 7;
  2. X text 15 193 0;
  3. X text 163 193 10;
  4. X text 209 193 13;
  5. X text 74 193 4;
  6. X text 44 193 2;
  7. X text 90 193 5;
  8. X text 105 193 6;
  9. X text 60 193 3;
  10. X text 136 193 8;
  11. X text 153 193 9;
  12. X text 179 193 11;
  13. X text 194 193 12;
  14. X text 30 193 1;
  15. X msg 14 288 analog 0 0;
  16. N canvas 66 58 423 503 analog 0;
  17. X obj 38 10 inlet;
  18. X obj 131 10 inlet;
  19. X obj 38 259 pack float float;
  20. X obj 192 113 route float symbol;
  21. X obj 188 259 pack float symbol;
  22. X text 78 11 pin#;
  23. X text 179 10 PWM value or "off";
  24. X obj 39 217 cyclone/gate 2;
  25. X msg 191 153 1;
  26. X msg 252 153 2;
  27. X obj 131 34 list;
  28. X obj 131 113 float;
  29. X obj 131 67 trigger bang anything;
  30. X obj 37 427 outlet;
  31. X obj 37 356 trigger bang anything;
  32. X obj 179 376 list;
  33. X msg 179 396 set \$1 \$2 \$3;
  34. X msg 37 308 analog \$1 \$2;
  35. X connect 0 0 11 0;
  36. X connect 1 0 10 0;
  37. X connect 2 0 17 0;
  38. X connect 3 0 8 0;
  39. X connect 3 0 2 1;
  40. X connect 3 1 9 0;
  41. X connect 3 1 4 1;
  42. X connect 4 0 17 0;
  43. X connect 7 0 2 0;
  44. X connect 7 1 4 0;
  45. X connect 8 0 7 0;
  46. X connect 9 0 7 0;
  47. X connect 10 0 12 0;
  48. X connect 11 0 7 1;
  49. X connect 12 0 11 0;
  50. X connect 12 1 3 0;
  51. X connect 14 0 13 0;
  52. X connect 14 1 15 0;
  53. X connect 15 0 16 0;
  54. X connect 16 0 13 0;
  55. X connect 17 0 14 0;
  56. X restore 14 266 pd analog;
  57. X text 18 225 (switch pin to PWM or servo first);
  58. X obj -216 291 cnv 15 85 22 empty empty empty 20 12 0 14 -253938 -66577

0;

  1. 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;

  1. X obj -209 212 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -176124

-1 -1 0;

  1. X text -100 198 7;
  2. X text -207 198 0;
  3. X text -59 198 10;
  4. X text -13 198 13;
  5. X text -148 198 4;
  6. X text -178 198 2;
  7. X text -132 198 5;
  8. X text -117 198 6;
  9. X text -162 198 3;
  10. X text -86 198 8;
  11. X text -69 198 9;
  12. X text -43 198 11;
  13. X text -28 198 12;
  14. X text -192 198 1;
  15. X msg -208 293 analog 0 0;
  16. N canvas 66 58 423 503 analog 0;
  17. X obj 38 10 inlet;
  18. X obj 131 10 inlet;
  19. X obj 38 259 pack float float;
  20. X obj 192 113 route float symbol;
  21. X obj 188 259 pack float symbol;
  22. X text 78 11 pin#;
  23. X text 179 10 PWM value or "off";
  24. X obj 39 217 cyclone/gate 2;
  25. X msg 191 153 1;
  26. X msg 252 153 2;
  27. X obj 131 34 list;
  28. X obj 131 113 float;
  29. X obj 131 67 trigger bang anything;
  30. X obj 37 427 outlet;
  31. X obj 37 356 trigger bang anything;
  32. X obj 179 376 list;
  33. X msg 179 396 set \$1 \$2 \$3;
  34. X msg 37 308 analog \$1 \$2;
  35. X connect 0 0 11 0;
  36. X connect 1 0 10 0;
  37. X connect 2 0 17 0;
  38. X connect 3 0 8 0;
  39. X connect 3 0 2 1;
  40. X connect 3 1 9 0;
  41. X connect 3 1 4 1;
  42. X connect 4 0 17 0;
  43. X connect 7 0 2 0;
  44. X connect 7 1 4 0;
  45. X connect 8 0 7 0;
  46. X connect 9 0 7 0;
  47. X connect 10 0 12 0;
  48. X connect 11 0 7 1;
  49. X connect 12 0 11 0;
  50. X connect 12 1 3 0;
  51. X connect 14 0 13 0;
  52. X connect 14 1 15 0;
  53. X connect 15 0 16 0;
  54. X connect 16 0 13 0;
  55. X connect 17 0 14 0;
  56. X restore -208 271 pd analog;
  57. X text -205 230 (switch pin to PWM or servo first);
  58. X obj -224 -52 dumpOSC 8000;
  59. X floatatom -185 4 5 0 0 0 - - -;
  60. X obj -226 -18 OSCroute /1;
  61. X obj -195 38 s page-1;
  62. X obj -106 -141 r page-1;
  63. X floatatom -106 -63 5 0 0 0 - - -;
  64. X obj -106 -119 OSCroute /fb /lr;
  65. X obj -106 -90 moses 0.5;
  66. X obj -106 -34 * -1;
  67. X floatatom -106 40 5 0 0 0 - - -;
  68. X obj -106 -10 + 0.5;
  69. X obj -106 16 * 2;
  70. X floatatom -55 -5 5 0 0 0 - - -;
  71. X obj -55 -59 - 0.5;
  72. X obj -55 -29 * 2;
  73. X floatatom 1 -65 5 0 0 0 - - -;
  74. X obj 1 -92 moses 0.5;
  75. X obj 1 -36 * -1;
  76. X floatatom 1 38 5 0 0 0 - - -;
  77. X obj 1 -12 + 0.5;
  78. X obj 1 14 * 2;
  79. X floatatom 52 -7 5 0 0 0 - - -;
  80. X obj 52 -61 - 0.5;
  81. X obj 52 -31 * 2;
  82. X connect 3 0 70 0;
  83. X connect 4 0 3 0;
  84. X connect 4 1 6 0;
  85. X connect 6 0 70 0;
  86. X connect 7 0 91 1;
  87. X connect 8 0 37 1;
  88. X connect 9 0 70 0;
  89. X connect 10 0 70 0;
  90. X connect 11 0 10 0;
  91. X connect 19 0 91 0;
  92. X connect 34 0 70 0;
  93. X connect 35 0 70 0;
  94. X connect 36 0 70 0;
  95. X connect 37 0 44 0;
  96. X connect 38 0 70 0;
  97. X connect 39 0 70 0;
  98. X connect 40 0 39 0;
  99. X connect 44 0 45 0;
  100. X connect 44 1 76 0;
  101. X connect 45 0 46 0;
  102. X connect 45 1 46 1;
  103. X connect 45 2 46 2;
  104. X connect 45 3 46 3;
  105. X connect 45 4 46 4;
  106. X connect 45 5 46 5;
  107. X connect 45 6 46 6;
  108. X connect 45 7 46 7;
  109. X connect 46 0 12 0;
  110. X connect 46 1 13 0;
  111. X connect 46 2 14 0;
  112. X connect 46 3 15 0;
  113. X connect 46 4 16 0;
  114. X connect 46 5 17 0;
  115. X connect 46 6 42 0;
  116. X connect 46 7 43 0;
  117. X connect 47 2 48 0;
  118. X connect 47 3 49 0;
  119. X connect 47 4 50 0;
  120. X connect 47 5 51 0;
  121. X connect 47 6 52 0;
  122. X connect 47 7 53 0;
  123. X connect 47 8 54 0;
  124. X connect 47 9 55 0;
  125. X connect 47 10 56 0;
  126. X connect 47 11 57 0;
  127. X connect 47 12 58 0;
  128. X connect 47 13 59 0;
  129. X connect 61 0 71 0;
  130. X connect 62 0 63 0;
  131. X connect 62 1 64 0;
  132. X connect 70 0 37 0;
  133. X connect 70 1 81 0;
  134. X connect 72 0 70 0;
  135. X connect 73 0 70 0;
  136. X connect 75 0 70 0;
  137. X connect 76 0 47 0;
  138. X connect 76 1 62 0;
  139. X connect 76 2 74 0;
  140. X connect 76 3 82 0;
  141. X connect 79 0 9 0;
  142. X connect 81 0 61 0;
  143. X connect 85 0 38 0;
  144. X connect 91 0 34 0;
  145. X connect 94 0 111 1;
  146. X connect 95 0 111 0;
  147. X connect 110 0 70 0;
  148. X connect 111 0 110 0;
  149. X connect 114 0 131 1;
  150. X connect 115 0 131 0;
  151. X connect 130 0 70 0;
  152. X connect 131 0 130 0;
  153. X connect 134 0 151 1;
  154. X connect 135 0 151 0;
  155. X connect 150 0 70 0;
  156. X connect 151 0 150 0;
  157. X connect 153 0 155 0;
  158. X connect 155 0 154 0;
  159. X connect 155 0 156 0;
  160. X connect 157 0 159 0;
  161. X connect 158 0 161 0;
  162. X connect 159 0 160 0;
  163. X connect 159 1 169 0;
  164. X connect 160 0 158 0;
  165. X connect 160 1 166 0;
  166. X connect 161 0 163 0;
  167. X connect 162 0 91 1;
  168. X connect 163 0 164 0;
  169. X connect 164 0 162 0;
  170. X connect 165 0 111 1;
  171. X connect 166 0 167 0;
  172. X connect 167 0 165 0;
  173. X connect 168 0 170 0;
  174. X connect 169 0 168 0;
  175. X connect 169 1 175 0;
  176. X connect 170 0 172 0;
  177. X connect 171 0 131 1;
  178. X connect 172 0 173 0;
  179. X connect 173 0 171 0;
  180. X connect 174 0 151 1;
  181. X connect 175 0 176 0;
  182. 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
*/
  1. include <Firmata.h>
  2. 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*****