aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-10-05 22:28:09 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-10-05 22:28:09 +0000
commitebb9d4e9b027f595071552f7ae082d953bc232bc (patch)
treee212419b79335e7c82c424154a15f12927f941da
parenta763efa94267d32ad515589893e347ed82a7376e (diff)
removed ancient not very useful Pd+Arduino examples to avoid confusion
svn path=/trunk/externals/hardware/arduino/; revision=12537
-rw-r--r--examples/PD_all_inputs.pd228
-rw-r--r--examples/PD_inputs_to_PD.pd127
-rw-r--r--examples/PD_send_potentiometer.pd44
-rw-r--r--examples/PD_two_potentiometers.pd83
-rw-r--r--examples/Pd_Input/Pd_Input.pde71
5 files changed, 0 insertions, 553 deletions
diff --git a/examples/PD_all_inputs.pd b/examples/PD_all_inputs.pd
deleted file mode 100644
index a920736..0000000
--- a/examples/PD_all_inputs.pd
+++ /dev/null
@@ -1,228 +0,0 @@
-#N canvas 510 32 651 721 10;
-#X obj 480 668 import cyclone zexy;
-#X obj 21 78 nbx 4 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 91 78 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 161 78 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 231 78 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 301 78 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 371 78 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 21 132 nbx 6 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--3754 -1 -1 716 256;
-#X obj 122 132 nbx 6 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--3754 -1 -1 717 256;
-#X obj 223 132 nbx 6 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--3754 -1 -1 492 256;
-#X text 160 241 On Mac OS X \, set this to the right value:;
-#X msg 100 220 open \$1;
-#X text 15 156 You might need to select another port \, check the Pd
-window to see if it connected successfully:;
-#X obj 724 492;
-#X msg 823 352;
-#X obj 838 350;
-#X msg 820 369;
-#X text 16 5 This patch works with the example Arduino firmware of
-the same name.;
-#N canvas 162 133 530 380 serin 0;
-#X obj 120 61 cnv 15 15 15 empty \$0-number-canvas 0 4 7 0 14 -233017
--1 0;
-#X obj 200 225 s \$0-number-canvas;
-#X obj 60 61 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -225271 -1
--1 0;
-#X obj 59 147 outlet;
-#X obj 60 13 inlet;
-#X msg 200 202 label \$1;
-#X obj 200 180 makefilename %d;
-#X obj 59 108 float;
-#X connect 2 0 7 0;
-#X connect 4 0 2 0;
-#X connect 5 0 1 0;
-#X connect 6 0 5 0;
-#X connect 7 0 3 0;
-#X connect 7 0 6 0;
-#X coords 0 -1 1 1 76 17 1 60 60;
-#X restore 100 197 pd serin;
-#X text 181 198 serial port #;
-#X obj 91 58 receive E;
-#X obj 21 58 receive D;
-#X obj 161 58 receive F;
-#X obj 231 58 receive G;
-#X obj 301 58 receive H;
-#X obj 371 58 receive I;
-#X text 12 95 potentiometers:;
-#X text 10 39 pushbuttons;
-#X text 281 675 released under the GNU GPL;
-#X text 67 660 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
-;
-#X obj 324 132 nbx 6 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--3754 -1 -1 2 256;
-#X obj 425 132 nbx 6 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--3754 -1 -1 620 256;
-#X obj 526 132 nbx 6 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--3754 -1 -1 20 256;
-#X obj 100 308 spigot;
-#X obj 150 310 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-1;
-#X msg 160 220 close;
-#X obj 31 633 print --------------------;
-#N canvas 630 546 462 312 alternate 0;
-#X obj 87 8 inlet;
-#X obj 151 244 outlet;
-#X obj 319 247 outlet;
-#X obj 159 197 spigot;
-#X obj 319 191 spigot;
-#X obj 158 57 trigger anything bang;
-#X obj 196 152 abs;
-#X floatatom 212 198 5 0 0 0 - - -;
-#X obj 356 147 abs;
-#X msg 295 77 1;
-#X obj 196 173 float;
-#X obj 355 168 float;
-#X obj 86 34 route reset;
-#X obj 356 128 -;
-#X obj 196 133 -;
-#X obj 15 35 loadbang;
-#X obj 86 54 bang;
-#X msg 73 82 1;
-#X msg 103 82 0;
-#X connect 0 0 12 0;
-#X connect 3 0 1 0;
-#X connect 4 0 2 0;
-#X connect 5 0 3 0;
-#X connect 5 0 4 0;
-#X connect 5 1 9 0;
-#X connect 6 0 10 0;
-#X connect 8 0 11 0;
-#X connect 9 0 13 0;
-#X connect 9 0 14 0;
-#X connect 10 0 3 1;
-#X connect 10 0 7 0;
-#X connect 10 0 14 1;
-#X connect 11 0 4 1;
-#X connect 11 0 13 1;
-#X connect 12 0 16 0;
-#X connect 12 1 5 0;
-#X connect 13 0 8 0;
-#X connect 14 0 6 0;
-#X connect 15 0 18 0;
-#X connect 15 0 17 0;
-#X connect 16 0 18 0;
-#X connect 16 0 17 0;
-#X connect 17 0 14 1;
-#X connect 18 0 13 1;
-#X restore 179 407 pd alternate;
-#X msg 100 361 reset;
-#X obj 100 287 comport 0 9600;
-#X obj 218 366 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 258 427 * 32;
-#X obj 242 448 +;
-#X obj 242 469 trigger bang float;
-#X obj 250 601 pack symbol float;
-#X obj 232 579 makefilename \$0-%c;
-#X msg 251 624 \; \$1 \$2;
-#X obj 21 112 receive \$0-A;
-#X obj 122 112 receive \$0-B;
-#X obj 223 112 receive \$0-C;
-#X obj 324 112 receive \$0-D;
-#X obj 425 112 receive \$0-E;
-#X obj 526 112 receive \$0-F;
-#X obj 232 525 +;
-#X obj 260 525 float;
-#X msg 261 504 0;
-#X msg 232 504 1;
-#X obj 232 555 + 64;
-#X obj 6 580 spigot;
-#X obj 44 552 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
-;
-#X obj 360 397 gate 4;
-#X obj 351 421 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 369 421 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 388 421 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 407 421 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 398 376 metro 400;
-#X obj 399 356 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-1;
-#X obj 327 323 float;
-#X obj 370 323 + 1;
-#X obj 327 289 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 413 321 bang;
-#X msg 346 289 1;
-#X obj 327 345 moses 5;
-#X obj 100 335 select 255;
-#X msg 164 259 devicename /dev/tty.usbserial-1913;
-#X obj 45 435 spigot;
-#X obj 83 407 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
-;
-#X obj 108 480 print RAW;
-#X obj 42 460 select 255;
-#X connect 7 0 58 0;
-#X connect 11 0 39 0;
-#X connect 18 0 11 0;
-#X connect 20 0 2 0;
-#X connect 21 0 1 0;
-#X connect 22 0 3 0;
-#X connect 23 0 4 0;
-#X connect 24 0 5 0;
-#X connect 25 0 6 0;
-#X connect 33 0 73 0;
-#X connect 34 0 33 1;
-#X connect 35 0 39 0;
-#X connect 37 0 42 0;
-#X connect 37 1 41 0;
-#X connect 38 0 37 0;
-#X connect 38 0 55 0;
-#X connect 39 0 33 0;
-#X connect 39 0 75 0;
-#X connect 40 0 37 0;
-#X connect 41 0 42 1;
-#X connect 42 0 43 0;
-#X connect 43 0 56 0;
-#X connect 43 1 44 1;
-#X connect 44 0 46 0;
-#X connect 45 0 44 0;
-#X connect 47 0 7 0;
-#X connect 48 0 8 0;
-#X connect 49 0 9 0;
-#X connect 50 0 30 0;
-#X connect 51 0 31 0;
-#X connect 52 0 32 0;
-#X connect 53 0 54 0;
-#X connect 53 0 57 0;
-#X connect 54 0 53 1;
-#X connect 55 0 54 0;
-#X connect 56 0 53 0;
-#X connect 57 0 45 0;
-#X connect 58 0 36 0;
-#X connect 59 0 58 1;
-#X connect 60 0 61 0;
-#X connect 60 1 62 0;
-#X connect 60 2 63 0;
-#X connect 60 3 64 0;
-#X connect 65 0 60 1;
-#X connect 66 0 65 0;
-#X connect 67 0 72 0;
-#X connect 68 0 67 1;
-#X connect 69 0 67 0;
-#X connect 70 0 71 0;
-#X connect 71 0 67 0;
-#X connect 72 0 68 0;
-#X connect 72 0 60 0;
-#X connect 72 1 70 0;
-#X connect 73 0 38 0;
-#X connect 73 1 37 0;
-#X connect 74 0 39 0;
-#X connect 75 0 78 0;
-#X connect 76 0 75 1;
-#X connect 78 0 36 0;
-#X connect 78 1 77 0;
diff --git a/examples/PD_inputs_to_PD.pd b/examples/PD_inputs_to_PD.pd
deleted file mode 100644
index dacea7f..0000000
--- a/examples/PD_inputs_to_PD.pd
+++ /dev/null
@@ -1,127 +0,0 @@
-#N canvas 429 31 592 705 10;
-#X obj 480 668 import zexy;
-#X obj 21 78 nbx 4 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 91 78 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 161 78 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 231 78 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 301 78 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 371 78 nbx 3 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--241291 -1 -1 0 256;
-#X obj 21 132 nbx 6 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--3754 -1 -1 403 256;
-#X obj 122 132 nbx 6 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--3754 -1 -1 387 256;
-#X obj 223 132 nbx 6 16 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 14
--3754 -1 -1 410 256;
-#X text 160 241 On Mac OS X \, set this to the right value:;
-#X msg 100 220 open \$1;
-#X obj 100 287 comport 1 9600;
-#X text 15 156 You might need to select another port \, check the Pd
-window to see if it connected successfully:;
-#X obj 724 492;
-#X msg 823 352;
-#X obj 838 350;
-#X msg 820 369;
-#X msg 160 220 close;
-#X obj 100 311 select 10;
-#X text 16 5 This patch works with the example Arduino firmware of
-the same name.;
-#X msg 164 259 devicename /dev/tty.usbserial-191;
-#X obj 265 551 +;
-#X obj 235 572 float;
-#X obj 244 415 trigger float bang;
-#X obj 281 512 float;
-#X obj 281 531 * 10;
-#X obj 347 536 float;
-#X msg 311 493 0;
-#X text 336 493 <-- reset for the next pot reading;
-#X obj 121 572 makefilename %c;
-#X obj 121 596 pack symbol float;
-#X msg 122 625 \; \$1 \$2;
-#X obj 158 333 moses 64;
-#X obj 21 112 receive A;
-#X obj 122 112 receive B;
-#X obj 223 112 receive C;
-#X obj 91 58 receive E;
-#X obj 21 58 receive D;
-#X obj 161 58 receive F;
-#X obj 231 58 receive G;
-#X obj 301 58 receive H;
-#X obj 371 58 receive I;
-#X obj 244 365 makefilename %c;
-#X obj 244 385 symbol2list;
-#X obj 75 458 trigger float bang bang;
-#X obj 87 521 float;
-#X text 12 95 potentiometers:;
-#X text 10 39 pushbuttons;
-#X text 359 365 <-- convert integer to ASCII;
-#X text 327 384 <-- converts the ASCII digit;
-#X text 404 396 symbol to a float;
-#X text 170 311 <-- filter out newline characters;
-#X text 169 633 <-- send to a [receive] using the letter as the name
-;
-#X text 8 543 store letter to output with value;
-#X text 221 334 <-- split the labels from the data;
-#X text 281 675 released under the GNU GPL;
-#X text 67 660 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
-;
-#N canvas 162 133 562 412 serin 0;
-#X obj 220 101 cnv 13 14 13 empty \$0-number-canvas 1 4 7 0 14 -233017
--1 0;
-#X obj 241 251 s \$0-number-canvas;
-#X obj 100 100 hradio 15 1 0 8 empty empty empty 0 -6 0 8 -225271 -1
--1 1;
-#X obj 100 173 outlet;
-#X obj 101 39 inlet;
-#X msg 241 228 label \$1;
-#X obj 241 206 makefilename %d;
-#X obj 101 134 float;
-#X connect 2 0 7 0;
-#X connect 4 0 2 0;
-#X connect 5 0 1 0;
-#X connect 6 0 5 0;
-#X connect 7 0 3 0;
-#X connect 7 0 6 0;
-#X coords 0 -1 1 1 136 15 1 100 100;
-#X restore 100 198 pd serin;
-#X text 240 199 serial port #;
-#X connect 11 0 12 0;
-#X connect 12 0 19 0;
-#X connect 18 0 12 0;
-#X connect 19 1 33 0;
-#X connect 21 0 12 0;
-#X connect 22 0 23 1;
-#X connect 22 0 27 0;
-#X connect 23 0 31 1;
-#X connect 24 0 22 0;
-#X connect 24 1 25 0;
-#X connect 25 0 26 0;
-#X connect 26 0 22 1;
-#X connect 27 0 25 1;
-#X connect 28 0 25 1;
-#X connect 30 0 31 0;
-#X connect 31 0 32 0;
-#X connect 33 0 43 0;
-#X connect 33 1 45 0;
-#X connect 34 0 7 0;
-#X connect 35 0 8 0;
-#X connect 36 0 9 0;
-#X connect 37 0 2 0;
-#X connect 38 0 1 0;
-#X connect 39 0 3 0;
-#X connect 40 0 4 0;
-#X connect 41 0 5 0;
-#X connect 42 0 6 0;
-#X connect 43 0 44 0;
-#X connect 44 0 24 0;
-#X connect 45 0 46 1;
-#X connect 45 1 46 0;
-#X connect 45 2 28 0;
-#X connect 45 2 23 0;
-#X connect 46 0 30 0;
-#X connect 58 0 11 0;
diff --git a/examples/PD_send_potentiometer.pd b/examples/PD_send_potentiometer.pd
deleted file mode 100644
index 765019d..0000000
--- a/examples/PD_send_potentiometer.pd
+++ /dev/null
@@ -1,44 +0,0 @@
-#N canvas 625 217 510 370 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 10 256;
-#X msg 101 100 open \$1;
-#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 text 247 338 released under the GNU GPL;
-#X text 33 323 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
-;
-#N canvas 162 133 562 412 serin 0;
-#X obj 220 101 cnv 13 14 13 empty \$0-number-canvas 0 4 7 0 14 -233017
--1 0;
-#X obj 241 251 s \$0-number-canvas;
-#X obj 100 100 hradio 15 1 0 8 empty empty empty 0 -6 0 8 -225271 -1
--1 0;
-#X obj 100 173 outlet;
-#X obj 101 39 inlet;
-#X msg 241 228 label \$1;
-#X obj 241 206 makefilename %d;
-#X obj 101 134 float;
-#X connect 2 0 7 0;
-#X connect 4 0 2 0;
-#X connect 5 0 1 0;
-#X connect 6 0 5 0;
-#X connect 7 0 3 0;
-#X connect 7 0 6 0;
-#X coords 0 -1 1 1 136 15 1 100 100;
-#X restore 101 78 pd serin;
-#X text 241 79 serial port #;
-#X connect 1 0 5 0;
-#X connect 3 0 1 0;
-#X connect 4 0 1 0;
-#X connect 6 0 1 0;
-#X connect 11 0 6 0;
diff --git a/examples/PD_two_potentiometers.pd b/examples/PD_two_potentiometers.pd
deleted file mode 100644
index 76550ca..0000000
--- a/examples/PD_two_potentiometers.pd
+++ /dev/null
@@ -1,83 +0,0 @@
-#N canvas 747 74 537 637 10;
-#X obj 431 598 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 110 496 nbx 4 20 -1e+37 1e+37 0 0 empty empty Analog_in_0 -15
-30 1 14 -3754 -1 -1 406 256;
-#N canvas 162 133 562 412 serin 0;
-#X obj 220 101 cnv 13 14 13 empty \$0-number-canvas 0 4 7 0 14 -233017
--1 0;
-#X obj 241 251 s \$0-number-canvas;
-#X obj 100 100 hradio 15 1 0 8 empty empty empty 0 -6 0 8 -225271 -1
--1 0;
-#X obj 100 173 outlet;
-#X obj 101 39 inlet;
-#X msg 241 228 label \$1;
-#X obj 241 206 makefilename %d;
-#X obj 101 134 float;
-#X connect 2 0 7 0;
-#X connect 4 0 2 0;
-#X connect 5 0 1 0;
-#X connect 6 0 5 0;
-#X connect 7 0 3 0;
-#X connect 7 0 6 0;
-#X coords 0 -1 1 1 136 15 1 100 100;
-#X restore 77 78 pd serin;
-#X msg 77 103 open \$1;
-#X text 217 79 serial port #;
-#X text 4 -3 This patch works with the example Arduino firmware of
-the same name.;
-#X text 20 537 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 495 nbx 4 20 -1e+37 1e+37 0 0 empty empty Analog_in_1 -15
-30 1 14 -3754 -1 -1 3.70039e+18 256;
-#X text 227 606 released under the GNU GPL;
-#X text 13 591 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
-;
-#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;
diff --git a/examples/Pd_Input/Pd_Input.pde b/examples/Pd_Input/Pd_Input.pde
deleted file mode 100644
index c2d574f..0000000
--- a/examples/Pd_Input/Pd_Input.pde
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Pd_Input
- * ------------------
- *
- * This program reads all of the Analog and 12 Digital Inputs
- * and sends the data to the computer as fast as possible.
- * It reads one analog pin and two digital pins per cycle
- * so that the time between reads on all pins remains
- * constant.
- *
- * It was designed to work with the Pd patch of the same
- * name in: Help -> Browser -> examples -> hardware
- *
- * (cleft) 2006 Hans-Christoph Steiner
- * @author: Hans-Christoph Steiner
- * @date: 2006-03-10
- * @location: Polytechnic University, Brooklyn, New York, USA
- */
-
-/*
- * CAUTION!! Do not turn on the Serial Monitor, it could freeze
- * your computer with this firmware running! It outputs data
- * without a delay() so its very fast.
- */
-
-int i;
-int analogPin = 0;
-int digitalPin = 0;
-int ledOut = 1;
-int analogData = 0;
-int digitalData = 0;
-int digitalOutputByte = 0;
-void setup() {
- beginSerial(9600);
-}
-
-void loop() {
- /*
- * get two digital ins
- */
- digitalOutputByte = 0;
- for(i=0;i<7;++i)
- {
- digitalData = digitalRead(i);
- digitalOutputByte = digitalOutputByte + (2^(i+1)*digitalData);
- }
- printByte(digitalOutputByte);
- digitalOutputByte = 0;
- for(i=7;i<13;++i)
- {
- digitalData = digitalRead(i);
- digitalOutputByte = digitalOutputByte + (2^(i-6)*digitalData);
- }
- printByte(digitalOutputByte);
- /*
- * get analog in
- */
- analogData = analogRead(analogPin);
- // these two bytes get converted back into the whole number in Pd
- printByte(analogData / 32); // div by 32 for the big byte
- printByte(analogData % 32); // mod by 32 for the small byte
- analogPin = analogPin + 1;
- if (analogPin > 5)
- {
- analogPin = 0;
- // toggle the status LED (pin 13)
- digitalWrite(13,ledOut);
- ledOut = !ledOut; // alternate the LED
- // the newline (ASCII 10) marks the start/end of the sequence
- printByte(255);
- }
-}