Update of /cvsroot/pure-data/externals/hardware/arduino/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20865
Modified Files: PD_inputs_to_PD.pd PD_send_potentiometer.pd Added Files: PD_all_inputs.pd PD_two_potentiometers.pd Log Message: some example patches for the existing puredata firmwares, and the start of firmware for getting all inputs into Pd as fast as possible. Some clean-up needed before a real release
Index: PD_inputs_to_PD.pd =================================================================== RCS file: /cvsroot/pure-data/externals/hardware/arduino/examples/PD_inputs_to_PD.pd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PD_inputs_to_PD.pd 4 Mar 2006 22:21:55 -0000 1.1 --- PD_inputs_to_PD.pd 5 Mar 2006 06:48:01 -0000 1.2 *************** *** 1,3 **** ! #N canvas 583 37 658 481 10; #X obj 29 56 r pushButton2; #X obj 29 76 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14 --- 1,3 ---- ! #N canvas 583 37 662 485 10; #X obj 29 56 r pushButton2; #X obj 29 76 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14 *************** *** 27,31 **** -3754 -1 -1 0 256; #X obj 369 109 r potentioMeter2; - #X msg 246 316 devicename /dev/tty.usbserial-181; #X text 242 298 On Mac OS X , set this to the right value:; #X msg 192 255 open $1; --- 27,30 ---- *************** *** 66,69 **** --- 65,69 ---- #X restore 192 232 pd serin; #X text 273 233 serial port #; + #X msg 246 316 devicename /dev/tty.usbserial-191; #X connect 0 0 1 0; #X connect 2 0 3 0; *************** *** 75,83 **** #X connect 15 0 14 0; #X connect 17 0 16 0; ! #X connect 18 0 21 0; ! #X connect 20 0 21 0; ! #X connect 21 0 29 0; ! #X connect 28 0 21 0; ! #X connect 29 0 32 0; ! #X connect 29 1 31 0; ! #X connect 34 0 20 0; --- 75,83 ---- #X connect 15 0 14 0; #X connect 17 0 16 0; ! #X connect 19 0 20 0; ! #X connect 20 0 28 0; ! #X connect 27 0 20 0; ! #X connect 28 0 31 0; ! #X connect 28 1 30 0; ! #X connect 33 0 19 0; ! #X connect 35 0 20 0;
--- NEW FILE: PD_all_inputs.pd --- #N canvas 159 48 492 617 10; #X obj 346 18 import zexy; #X text 112 148 On Mac OS X , set this to the right value:; #X text 5 38 You might need to select another port , check the Pd window to see if it connected successfully:; #X msg 136 120 close; #X msg 116 165 devicename /dev/tty.usbserial-191; #X obj 11 508 nbx 4 20 -1e+37 1e+37 0 0 empty empty ADC0 5 30 1 10 -3754 -1 -1 508 256; #N canvas 162 133 518 368 serin 0; #X obj 160 101 cnv 15 15 15 empty $0-number-canvas 1 4 7 0 14 -233017 -1 0; #X obj 241 251 s $0-number-canvas; #X obj 100 101 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -225271 -1 -1 0; #X obj 101 134 + 1; #X obj 100 173 outlet; #X obj 101 39 inlet; #X msg 241 228 label $1; #X obj 241 206 makefilename %d; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 7 0; #X connect 5 0 2 0; #X connect 6 0 1 0; #X connect 7 0 6 0; #X coords 0 -1 1 1 76 17 1 100 100; #X restore 77 71 pd serin; #X msg 77 119 open $1; #X text 4 -3 This patch works with the example Arduino firmware of the same name.; #X text 9 552 CAUTION! Watch out if you connect your potentiometer without an extra resistor , when you turn it all the way up , the full voltage and current will go to the input. This could fry your board!; #X obj 79 357 +; #X obj 78 259 trigger float bang; #X obj 95 318 float; #X obj 95 337 * 10; #X obj 176 345 float; #X msg 196 290 0; #X text 250 459 ASCII for A B C D E F; #X obj 77 235 - 48; #X obj 79 460 route 65 66 67 68 69 70; #X obj 79 378 trigger bang float; #X obj 79 417 float; #X obj 247 386 float; #X obj 79 440 pack float float; #X obj 61 508 nbx 4 20 -1e+37 1e+37 0 0 empty empty ADC1 5 30 1 10 -3754 -1 -1 0 256; #X obj 111 508 nbx 4 20 -1e+37 1e+37 0 0 empty empty ADC2 5 30 1 10 -3754 -1 -1 10 256; #X obj 161 508 nbx 4 20 -1e+37 1e+37 0 0 empty empty ADC3 5 30 1 10 -3754 -1 -1 98 256; #X obj 211 508 nbx 4 20 -1e+37 1e+37 0 0 empty empty ADC4 5 30 1 10 -3754 -1 -1 158 256; #X obj 261 508 nbx 4 20 -1e+37 1e+37 0 0 empty empty ADC5 5 30 1 10 -3754 -1 -1 623 256; #X obj 320 511 print ERRANT_VALUE; #X obj 247 250 float; #X obj 77 211 moses 58; #X text 84 88 (sometimes it takes up to 10 seconds to close the serial port , if things are running fast); #X text 181 121 <-- close before uploading a new firmware!; #X obj 77 188 comport 1 19200; #X connect 3 0 33 0; #X connect 4 0 33 0; #X connect 6 0 7 0; #X connect 7 0 33 0; #X connect 10 0 14 0; #X connect 10 0 19 0; #X connect 11 0 10 0; #X connect 11 1 12 0; #X connect 12 0 13 0; #X connect 13 0 10 1; #X connect 14 0 12 1; #X connect 15 0 12 1; #X connect 17 0 11 0; #X connect 18 0 5 0; #X connect 18 1 23 0; #X connect 18 2 24 0; #X connect 18 3 25 0; #X connect 18 4 26 0; #X connect 18 5 27 0; #X connect 18 6 28 0; #X connect 19 0 20 0; #X connect 19 1 22 1; #X connect 20 0 22 0; #X connect 21 0 20 1; #X connect 22 0 18 0; #X connect 29 0 15 0; #X connect 29 0 21 0; #X connect 30 0 17 0; #X connect 30 1 29 0; #X connect 33 0 30 0;
Index: PD_send_potentiometer.pd =================================================================== RCS file: /cvsroot/pure-data/externals/hardware/arduino/examples/PD_send_potentiometer.pd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PD_send_potentiometer.pd 4 Mar 2006 22:21:55 -0000 1.1 --- PD_send_potentiometer.pd 5 Mar 2006 06:48:01 -0000 1.2 *************** *** 1,15 **** ! #N canvas 66 362 494 354 10; ! #X text 153 122 On Mac OS X , set this to the right value:; ! #X obj 103 182 comport 1 9600; ! #X text 30 11 You might need to select another port , check the Pd window to see if it connected successfully:; ! #X msg 163 87 close; ! #X msg 157 139 devicename /dev/tty.usbserial-191; ! #X obj 102 215 nbx 6 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14 ! -3754 -1 -1 79 256; ! #X text 36 252 CAUTION! Watch out if you connect your potentiometer ! without an extra resistor , when you turn it all the way up , the ! full voltage and currrent will go to the input. This could kill your ! board!; #N canvas 162 133 518 368 serin 0; #X obj 160 101 cnv 15 15 15 empty $0-number-canvas 1 4 7 0 14 -233017 --- 1,11 ---- ! #N canvas 66 362 498 358 10; ! #X text 151 136 On Mac OS X , set this to the right value:; ! #X obj 101 196 comport 1 9600; ! #X text 28 25 You might need to select another port , check the Pd window to see if it connected successfully:; ! #X msg 161 101 close; ! #X msg 155 153 devicename /dev/tty.usbserial-191; ! #X obj 100 229 nbx 6 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14 ! -3754 -1 -1 13 256; #N canvas 162 133 518 368 serin 0; #X obj 160 101 cnv 15 15 15 empty $0-number-canvas 1 4 7 0 14 -233017 *************** *** 30,41 **** #X connect 7 0 6 0; #X coords 0 -1 1 1 76 17 1 100 100; ! #X restore 103 61 pd serin; ! #X msg 103 86 open $1; ! #X text 184 62 serial port #; ! #X text 30 -20 This patch works with the example Arduino firmware of the same name.; #X connect 1 0 5 0; #X connect 3 0 1 0; #X connect 4 0 1 0; ! #X connect 7 0 8 0; ! #X connect 8 0 1 0; --- 26,41 ---- #X connect 7 0 6 0; #X coords 0 -1 1 1 76 17 1 100 100; ! #X restore 101 75 pd serin; ! #X msg 101 100 open $1; ! #X text 182 76 serial port #; ! #X text 28 -6 This patch works with the example Arduino firmware of the same name.; + #X text 34 266 CAUTION! Watch out if you connect your potentiometer + without an extra resistor , when you turn it all the way up , the + full voltage and current will go to the input. This could kill your + board!; #X connect 1 0 5 0; #X connect 3 0 1 0; #X connect 4 0 1 0; ! #X connect 6 0 7 0; ! #X connect 7 0 1 0;
--- NEW FILE: PD_two_potentiometers.pd --- #N canvas 327 35 530 629 10; #X obj 420 2 import zexy; #X text 127 139 On Mac OS X , set this to the right value:; #X obj 77 195 comport 1 9600; #X text 5 42 You might need to select another port , check the Pd window to see if it connected successfully:; #X msg 137 104 close; #X msg 131 156 devicename /dev/tty.usbserial-191; #X obj 111 506 nbx 4 20 -1e+37 1e+37 0 0 empty empty Analog_in_0 -15 30 1 14 -3754 -1 -1 0 256; #N canvas 162 133 518 368 serin 0; #X obj 160 101 cnv 15 15 15 empty $0-number-canvas 1 4 7 0 14 -233017 -1 0; #X obj 241 251 s $0-number-canvas; #X obj 100 101 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -225271 -1 -1 0; #X obj 101 134 + 1; #X obj 100 173 outlet; #X obj 101 39 inlet; #X msg 241 228 label $1; #X obj 241 206 makefilename %d; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 7 0; #X connect 5 0 2 0; #X connect 6 0 1 0; #X connect 7 0 6 0; #X coords 0 -1 1 1 76 17 1 100 100; #X restore 77 78 pd serin; #X msg 77 103 open $1; #X text 158 79 serial port #; #X text 4 -3 This patch works with the example Arduino firmware of the same name.; #X text 6 550 CAUTION! Watch out if you connect your potentiometer without an extra resistor , when you turn it all the way up , the full voltage and current will go to the input. This could fry your board!; #X obj 156 246 makefilename %c; #X obj 77 225 select 13 10; #X text 266 246 <-- convert integer to ASCII; #X obj 223 424 +; #X obj 193 470 float; #X obj 221 315 trigger float bang; #X obj 239 385 float; #X obj 239 404 * 10; #X obj 221 289 symbol2list; #X obj 320 412 float; #X msg 164 337 0; #X obj 150 470 float; #X text 197 339 <-- reset for the next pot reading; #X text 303 285 <-- converts the ASCII digit; #X text 332 297 symbol to a float; #X text 169 225 <-- filter out newline characters; #X obj 156 267 select B A; #X obj 209 506 nbx 4 20 -1e+37 1e+37 0 0 empty empty Analog_in_1 -15 30 1 14 -3754 -1 -1 0 256; #X connect 2 0 13 0; #X connect 4 0 2 0; #X connect 5 0 2 0; #X connect 7 0 8 0; #X connect 8 0 2 0; #X connect 12 0 28 0; #X connect 13 2 12 0; #X connect 15 0 16 1; #X connect 15 0 21 0; #X connect 15 0 23 1; #X connect 16 0 29 0; #X connect 17 0 15 0; #X connect 17 1 18 0; #X connect 18 0 19 0; #X connect 19 0 15 1; #X connect 20 0 17 0; #X connect 21 0 18 1; #X connect 22 0 18 1; #X connect 23 0 6 0; #X connect 28 0 22 0; #X connect 28 0 23 0; #X connect 28 1 22 0; #X connect 28 1 16 0; #X connect 28 2 20 0;