-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathserial_write-help.pd
56 lines (56 loc) · 3.49 KB
/
serial_write-help.pd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#N canvas 413 180 1128 637 10;
#X msg 54 407 close;
#X obj 37 14 cnv 15 400 40 empty empty empty 20 12 0 14 #c0d828 #404040 0;
#X text 866 524 Written by Alexandros Drymonitis;
#X msg 43 380 devices;
#X floatatom 103 388 5 0 0 0 - - - 0;
#X msg 103 407 open \$1;
#X text 610 242 Inlets:;
#X text 650 259 1st: bytes from [comport];
#X text 610 326 Outlets:;
#X text 49 19 [serial_write]: abstraction that works with Arduinos' Serial.write() function (with the use of [comport]);
#X text 40 78 [serial_write] is a vanilla abstraction that works with [comport] and Arduino's Serial.write() function.;
#X obj 43 512 serial_write analog 3 digital 3;
#X obj 43 535 unpack f f f, f 14;
#X obj 226 535 unpack f f f;
#X obj 226 558 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 260 558 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 295 558 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X floatatom 43 559 5 0 0 0 - - - 0;
#X floatatom 83 559 5 0 0 0 - - - 0;
#X floatatom 124 559 5 0 0 0 - - - 0;
#X text 40 250 This help patch works with the serial_write.ino sketch. Check it for more information.;
#X text 585 26 Arguments:;
#X text 644 47 1st (obligatory): type of pins you are reading (analog or digital);
#X text 647 75 2nd (obligatory): number of pins of the type specified by the first argument;
#X text 648 107 3rd (optional): type of pins you are reading (if first argument is "analog" \, then this is "digital" \, and vice versa);
#X text 647 151 4th (optional. if third argument provided \, then this is obligatory as well): number of pins of the type specified by the third argument;
#X text 650 278 2nd: message to set number of pins with type;
#X text 654 344 1st: list of values of the type specified by the first argument;
#X text 654 379 2nd: list of values of the type specified by the third argument;
#X text 650 297 3rd: data stream initializer (defualts to 192);
#X text 648 197 5th (optional): data stream initializer (defaults to 192 \, check the serial_write.ino Arduino sketch for more details);
#X msg 339 494 255;
#X text 203 448 change number of analog and digital pins read;
#X text 373 489 change data stream initializer (should be between 128 and 255 \, default is 192);
#X text 41 115 You must specify the type of pins you want to read (analog or digital) and how many pins of this type you'll be reading. At least two arguments are necessary \, the third and fourth are optional \, you don't need them in case you read only one kind of pins. The fifth argument is also optional and sets a data stream initializer which defaults to 192 The order of the first four arguments must be aligned with the Arduino code. If you first read the analog pins \, then the first argument must be "analog" \, like in the example below.;
#X text 41 281 Note: the digital pins are using the internal pull-up resistors \, using INPUT_PULLUP \, so you don't need to use resistors for switches in your circuit. For this reason the readings of the digital pins are inverted in the Arduino code so you get a 1 when you press a switch and a 0 when you release it.;
#X msg 134 450 analog 0;
#X msg 149 475 digital 1;
#X obj 43 470 comport 0 57600;
#X connect 0 0 38 0;
#X connect 3 0 38 0;
#X connect 4 0 5 0;
#X connect 5 0 38 0;
#X connect 11 0 12 0;
#X connect 11 1 13 0;
#X connect 12 0 17 0;
#X connect 12 1 18 0;
#X connect 12 2 19 0;
#X connect 13 0 14 0;
#X connect 13 1 15 0;
#X connect 13 2 16 0;
#X connect 31 0 11 2;
#X connect 36 0 11 1;
#X connect 37 0 11 1;
#X connect 38 0 11 0;