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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
|
#N canvas 89 22 674 563 10;
#N canvas 233 472 466 316 INSTALL-NOTES 0;
#X text 39 201 [comport] \, from pd-cvs/externals/iem/comport;
#X text 39 185 [arduino] \, from pd-cvs/externals/hardware/arduino
;
#X text 39 217 [speedlim] \, from iemlib \, pd-cvs/externals/iemlib
;
#X text 20 27 1 General information on arduino: http://www.arduino.cc
;
#X text 21 159 4 Pduino needs the following externals and abstractions:
;
#X text 22 257 5 If you still have troubles \, mail to the pd list
!;
#X text 20 61 2 You need to install a Firmata firmware. There are a
bunch of Firmata firmwares included with Arduino. Use Arduino 18 or
newer for best results.;
#X text 20 108 3 The StandardFirmata firmware is the best place to
start.;
#X restore 25 72 pd INSTALL-NOTES;
#X text 150 73 <- read this first !;
#X msg 48 169 close;
#X msg 58 194 info;
#N canvas 248 49 447 555 DIGITAL-OUTPUT 0;
#X text 72 97 I/O the individual pins:;
#X text 20 22 NOTE: don't forget to set pins to output mode first!
;
#X obj 40 194 cnv 15 100 22 empty empty empty 20 12 0 14 -253938 -66577
0;
#X msg 49 197 digital 13 0;
#X obj 168 134 tgl 15 0 empty empty 7 4 -6 1 12 -233017 -1 -1 0 1;
#X obj 185 134 tgl 15 0 empty empty 8 4 -6 1 12 -233017 -1 -1 0 1;
#X obj 202 134 tgl 15 0 empty empty 9 4 -6 1 12 -233017 -1 -1 0 1;
#X obj 219 134 tgl 15 0 empty empty 10 0 -6 1 12 -233017 -1 -1 0 1
;
#X obj 236 134 tgl 15 0 empty empty 11 0 -6 1 12 -233017 -1 -1 0 1
;
#X obj 253 134 tgl 15 0 empty empty 12 0 -6 1 12 -233017 -1 -1 0 1
;
#X obj 270 134 tgl 15 0 empty empty 13 0 -6 1 12 -233017 -1 -1 0 1
;
#X obj 83 134 tgl 15 0 empty empty 2 4 -6 1 12 -233017 -1 -1 0 1;
#X obj 100 134 tgl 15 0 empty empty 3 4 -6 1 12 -233017 -1 -1 0 1;
#X obj 117 134 tgl 15 0 empty empty 5 4 -6 1 12 -233017 -1 -1 0 1;
#X obj 134 134 tgl 15 0 empty empty 6 4 -6 1 12 -233017 -1 -1 0 1;
#X obj 151 134 tgl 15 0 empty empty 7 4 -6 1 12 -233017 -1 -1 0 1;
#N canvas 474 328 810 360 generate 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 digital 0 \$1;
#X msg 89 88 digital 1 \$1;
#X msg 128 110 digital 2 \$1;
#X msg 168 130 digital 3 \$1;
#X msg 208 62 digital 4 \$1;
#X msg 248 84 digital 5 \$1;
#X msg 287 106 digital 6 \$1;
#X msg 327 126 digital 7 \$1;
#X msg 368 58 digital 8 \$1;
#X msg 408 80 digital 9 \$1;
#X msg 447 102 digital 10 \$1;
#X msg 487 122 digital 11 \$1;
#X msg 527 50 digital 12 \$1;
#X obj 566 23 inlet;
#X msg 566 70 digital 13 \$1;
#X obj 305 196 prepend set;
#X obj 305 254 outlet;
#X obj 305 215 trigger bang anything;
#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 28 0;
#X connect 14 0 28 0;
#X connect 15 0 28 0;
#X connect 16 0 28 0;
#X connect 17 0 28 0;
#X connect 18 0 28 0;
#X connect 19 0 28 0;
#X connect 20 0 28 0;
#X connect 21 0 28 0;
#X connect 22 0 28 0;
#X connect 23 0 28 0;
#X connect 24 0 28 0;
#X connect 25 0 28 0;
#X connect 26 0 27 0;
#X connect 27 0 28 0;
#X connect 28 0 30 0;
#X connect 30 0 29 0;
#X connect 30 1 29 0;
#X restore 49 158 pd generate digital out messages;
#X obj 319 109 tgl 25 0 empty empty ALL 2 12 0 12 -262144 -1 -1 0 1
;
#X obj 319 70 tgl 15 0 empty empty empty 0 -6 0 8 -225271 -1 -1 0 16383
;
#X obj 319 88 metro 100;
#X obj 49 280 send \$0-arduino;
#X text 143 197 <-- this is the message format;
#X text 181 69 strobe all pins -->;
#X obj 49 134 tgl 15 0 empty empty 0 3 -6 1 12 -260818 -1 -1 0 1;
#X obj 66 134 tgl 15 0 empty empty 1 3 -6 1 12 -260818 -1 -1 0 1;
#X obj 49 134 cnv 15 15 15 empty empty Rx 1 10 0 11 -128992 -86277
0;
#X obj 66 134 cnv 15 15 15 empty empty Tx 1 10 0 11 -128992 -13381
0;
#X obj 49 510 send \$0-arduino;
#X text 38 311 You can also send digital messages 8-bits at a time
\, called a "port". Microcontrollers like the Arduino are organized
around 8-bit ports. This allows you to set 8 pins at the same time
with one message;
#X msg 267 392 port 1 0;
#X msg 123 391 port 0 0;
#X msg 49 391 port 0 255;
#X msg 193 392 port 1 255;
#X connect 3 0 20 0;
#X connect 4 0 16 7;
#X connect 5 0 16 8;
#X connect 6 0 16 9;
#X connect 7 0 16 10;
#X connect 8 0 16 11;
#X connect 9 0 16 12;
#X connect 10 0 16 13;
#X connect 11 0 16 2;
#X connect 12 0 16 3;
#X connect 13 0 16 4;
#X connect 14 0 16 5;
#X connect 15 0 16 6;
#X connect 16 0 3 0;
#X connect 17 0 10 0;
#X connect 17 0 9 0;
#X connect 17 0 8 0;
#X connect 17 0 7 0;
#X connect 17 0 6 0;
#X connect 17 0 5 0;
#X connect 17 0 4 0;
#X connect 17 0 15 0;
#X connect 17 0 14 0;
#X connect 17 0 13 0;
#X connect 17 0 12 0;
#X connect 17 0 11 0;
#X connect 18 0 19 0;
#X connect 19 0 17 0;
#X connect 29 0 27 0;
#X connect 30 0 27 0;
#X connect 31 0 27 0;
#X connect 32 0 27 0;
#X restore 61 411 pd DIGITAL-OUTPUT;
#N canvas 494 94 578 280 DIGITAL-INPUT 0;
#X obj 114 67 r \$0-arduino-out;
#X text 387 93 connect the Digital Input;
#X text 387 110 to the ground (=0) or to;
#X text 387 127 the positive voltage (=1);
#X text 113 185 NOTE: if you don't connect your pin neither to + nor
to the ground \, you will get random values (0 or 1) - to avoid that
\, you could connect all the pins to the ground !;
#X text 114 32 NOTE: don't forget to set pins to input mode first!
;
#X obj 114 89 route digital;
#X obj 114 112 route 0 1 2 3 4 5 6 7 8 9 10 11 12 13;
#X obj 145 134 tgl 15 0 empty empty 2 4 23 1 12 -232448 -1 -1 0 1;
#X obj 162 134 tgl 15 0 empty empty 3 4 23 1 12 -232448 -1 -1 0 1;
#X obj 179 134 tgl 15 0 empty empty 4 4 23 1 12 -232448 -1 -1 0 1;
#X obj 196 134 tgl 15 0 empty empty 5 4 23 1 12 -232448 -1 -1 0 1;
#X obj 213 134 tgl 15 0 empty empty 6 4 23 1 12 -232448 -1 -1 0 1;
#X obj 230 134 tgl 15 0 empty empty 7 4 23 1 12 -232448 -1 -1 0 1;
#X obj 247 134 tgl 15 0 empty empty 8 4 23 1 12 -232448 -1 -1 0 1;
#X obj 264 134 tgl 15 0 empty empty 9 4 23 1 12 -232448 -1 -1 0 1;
#X obj 281 134 tgl 15 0 empty empty 10 0 23 1 12 -232448 -1 -1 0 1
;
#X obj 298 134 tgl 15 0 empty empty 11 0 23 1 12 -232448 -1 -1 0 1
;
#X obj 315 134 tgl 15 0 empty empty 12 0 23 1 12 -232448 -1 -1 0 1
;
#X obj 332 134 tgl 15 0 empty empty 13 0 23 1 12 -232448 -1 -1 0 1
;
#X obj 111 134 tgl 15 0 empty empty 0 4 23 1 12 -232448 -1 -1 0 1;
#X obj 128 134 tgl 15 0 empty empty 1 4 23 1 12 -232448 -1 -1 0 1;
#X obj 111 134 cnv 15 15 15 empty empty Rx 1 10 0 11 -128992 -86277
0;
#X obj 128 134 cnv 15 15 15 empty empty Tx 1 10 0 11 -128992 -13381
0;
#X text 12 134 (serial port)->;
#X connect 0 0 6 0;
#X connect 6 0 7 0;
#X connect 7 2 8 0;
#X connect 7 3 9 0;
#X connect 7 4 10 0;
#X connect 7 5 11 0;
#X connect 7 6 12 0;
#X connect 7 7 13 0;
#X connect 7 8 14 0;
#X connect 7 9 15 0;
#X connect 7 10 16 0;
#X connect 7 11 17 0;
#X connect 7 12 18 0;
#X connect 7 13 19 0;
#X restore 68 387 pd DIGITAL-INPUT;
#X text 310 154 Set input/output mode of the pins for digital IO:;
#N canvas 268 170 441 343 ANALOG-INPUT 0;
#X obj 121 70 r \$0-arduino-out;
#X obj 121 108 spigot 0;
#X obj 183 105 tgl 20 0 empty empty empty 0 -6 0 8 -258699 -1 -1 0
1;
#X text 30 24 Analog Inputs of the Arduino-Board:;
#X text 211 107 <- enable analog inputs;
#X text 25 283 NOTE: connect the analog pins that you don't use to
the ground \, if you want to avoid flickering of the values !;
#X floatatom 22 226 5 0 0 3 a0 - -;
#X floatatom 68 226 5 0 0 3 a1 - -;
#X floatatom 114 226 5 0 0 3 a2 - -;
#X floatatom 160 226 5 0 0 3 a3 - -;
#X floatatom 206 226 5 0 0 3 a4 - -;
#X floatatom 252 226 5 0 0 3 a5 - -;
#X floatatom 298 226 5 0 0 3 a6 - -;
#X floatatom 344 226 5 0 0 3 a7 - -;
#X obj 121 147 route analog;
#X obj 121 169 route 0 1 2 3 4 5 6 7;
#N canvas 0 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 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 restore 45 200 pd display values without pegging the CPU;
#X connect 0 0 1 0;
#X connect 1 0 14 0;
#X connect 2 0 1 1;
#X connect 14 0 15 0;
#X connect 15 0 16 0;
#X connect 15 1 16 1;
#X connect 15 2 16 2;
#X connect 15 3 16 3;
#X connect 15 4 16 4;
#X connect 15 5 16 5;
#X connect 15 6 16 6;
#X connect 15 7 16 7;
#X connect 16 0 6 0;
#X connect 16 1 7 0;
#X connect 16 2 8 0;
#X connect 16 3 9 0;
#X connect 16 4 10 0;
#X connect 16 5 11 0;
#X connect 16 6 12 0;
#X connect 16 7 13 0;
#X restore 73 435 pd ANALOG-INPUT;
#N canvas 462 480 562 378 ANALOG-OUTPUT-PWM 0;
#X text 16 17 Analog Output \, PWM (Pulse Width Modulation);
#X msg 21 189 pwm 9 \$1;
#X obj 24 168 hsl 150 17 0 1 0 0 empty empty PWM_control_(0-1) -2 -6
1 10 -260818 -1 -1 0 1;
#X obj 21 258 s \$0-arduino;
#X text 29 215 disable PWM:;
#X obj 192 168 hsl 150 17 0 1 0 0 empty empty PWM_control_(0-1) -2
-6 1 10 -260818 -1 -1 0 1;
#X obj 189 258 s \$0-arduino;
#X text 197 215 disable PWM:;
#X obj 354 168 hsl 150 17 0 1 0 0 empty empty PWM_control_(0-1) -2
-6 1 10 -260818 -1 -1 0 1;
#X obj 351 258 s \$0-arduino;
#X text 359 215 disable PWM:;
#X text 21 133 PIN9:;
#X text 189 135 PIN10:;
#X text 351 135 PIN11:;
#X msg 189 189 pwm 10 \$1;
#X msg 351 189 pwm 11 \$1;
#X text 21 319 NOTE: it is possible to write as well on the other pins
to send software-PWM signals (will come soon ...);
#X msg 31 234 pwm 9 0;
#X msg 199 234 pwm 10 0;
#X msg 361 234 pwm 11 0;
#X text 16 53 With the help of PWM you can write analog values to the
PWM pins of your Arduino board.;
#X text 17 89 NOTE: don't forget to set the pins to 'pwm' mode first
!;
#X connect 1 0 3 0;
#X connect 2 0 1 0;
#X connect 5 0 14 0;
#X connect 8 0 15 0;
#X connect 14 0 6 0;
#X connect 15 0 9 0;
#X connect 17 0 3 0;
#X connect 18 0 6 0;
#X connect 19 0 9 0;
#X restore 43 460 pd ANALOG-OUTPUT-PWM;
#X text 25 327 With the Arduino-Board you can do digital and analog
input and output \, as descriped in the following sub-patches:;
#X text 191 410 <- example of Digital Output;
#X text 191 388 <- example of Digital Input;
#X text 191 436 <- example of Analog Input;
#X text 191 461 <- example of Analog Output;
#X text 259 30 Arduino Interface For PD;
#X text 286 4 ::::_PDUINO_::::;
#X text 476 490 2006 \, released under GNU GPL \; Gerda Strobl \, Georg
Holzmann;
#X text 111 221 <- list devices;
#X obj 337 264 send \$0-arduino;
#X obj 476 91 send \$0-arduino-out;
#X obj 476 47 receive \$0-arduino;
#X obj 16 294 send \$0-arduino;
#N canvas 0 22 436 343 GETTING-INFO 0;
#X msg 147 65 version;
#X msg 207 65 info;
#X obj 146 177 route version;
#X floatatom 146 245 5 0 0 0 - - -;
#X floatatom 251 245 5 0 0 0 - - -;
#X obj 146 146 receive \$0-arduino-out;
#X obj 147 107 send \$0-arduino;
#X obj 146 221 unpack float float;
#X connect 0 0 6 0;
#X connect 1 0 6 0;
#X connect 2 0 7 0;
#X connect 5 0 2 0;
#X connect 7 0 3 0;
#X connect 7 1 4 0;
#X restore 73 508 pd GETTING-INFO;
#X text 191 509 <- example of getting status data;
#N canvas 477 400 471 273 SWITCHING-INPUTS 0;
#X obj 140 195 send \$0-arduino;
#X msg 25 123 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 junk_to_hide_outlet 0 5 9
1 12 -262130 -1 -1 0 1;
#X obj 75 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 1 5 9
1 12 -262130 -1 -1 0 1;
#X obj 90 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 2 5 9
1 12 -262130 -1 -1 0 1;
#X obj 105 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 3 5 9
1 12 -262130 -1 -1 0 1;
#X obj 120 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 4 5 9
1 12 -262130 -1 -1 0 1;
#X obj 135 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 5 5 9
1 12 -262130 -1 -1 0 1;
#X obj 150 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 6 5 9
1 12 -262130 -1 -1 0 1;
#X obj 165 61 tgl 15 0 junk_to_hide_inlet junk_to_hide_outlet 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 25 103 pd serin;
#X text 24 86 which analogIns to enable:;
#X msg 234 128 digitalIns 0 0;
#X text 233 91 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 234 108 pd seri;
#X text 23 15 Currently \, you have to tell StandardFirmata to send
you data from the inputs. For analog \, its controlled per-pin. For
digital it is controller per 8-pin "port".;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 4 0 0 0;
#X connect 6 0 4 0;
#X restore 49 533 pd SWITCHING-INPUTS;
#X msg 358 241 digital 13 \$1;
#X obj 358 223 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 476 70 arduino 1;
#X msg 58 220 devices;
#X text 92 194 <- info for current connection;
#X text 291 71 here is our Arduino object -->;
#X msg 58 246 version;
#X msg 31 149 open 1;
#N canvas 0 22 467 240 ver 0;
#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 23 52 zexy/makesymbol firmata_version_%s.%s;
#X obj 48 103 symbol;
#X obj 38 77 loadbang;
#X msg 96 78 bang;
#X obj 23 29 route version;
#X obj 23 6 receive \$0-arduino-out;
#X connect 2 0 1 0;
#X connect 3 0 2 0;
#X connect 4 0 2 0;
#X connect 5 0 4 0;
#X connect 6 0 4 0;
#X connect 7 0 3 0;
#X connect 8 0 7 0;
#X coords 0 -1 1 1 145 17 1 250 100;
#X restore 125 294 pd ver;
#X text 110 246 <- get protocol version;
#X text 110 271 <- get firmware version;
#X msg 58 271 firmware;
#X text 79 147 select the serial port;
#X text 99 169 close the serial port;
#X msg 357 189 pinMode 13 output;
#N canvas 213 217 432 341 SERVO 0;
#X obj 52 224 hsl 150 17 0 1 0 0 empty empty Servo_control_(0-1) -2
-6 1 10 -260818 -1 -1 0 1;
#X obj 49 274 s \$0-arduino;
#X text 27 141 disable PWM:;
#X obj 260 224 hsl 150 17 0 1 0 0 empty empty Servo_control_(0-1) -2
-6 1 10 -260818 -1 -1 0 1;
#X obj 257 274 s \$0-arduino;
#X text 235 141 disable PWM:;
#X text 19 119 PIN9:;
#X text 227 121 PIN10:;
#X text 14 13 Servo control;
#X msg 49 245 analog 9 \$1;
#X msg 257 245 analog 10 \$1;
#X msg 29 160 pinMode 9 servo;
#X msg 237 160 pinMode 10 servo;
#X text 15 40 You can control servo motors using Pd. First \, set the
pin to servo mode using the pinMode message \, then send analog values
to that pin with a range between 0 and 1 0 will set the position to
one extreme \, and 1 to the other.;
#X connect 0 0 9 0;
#X connect 3 0 10 0;
#X connect 9 0 1 0;
#X connect 10 0 4 0;
#X connect 11 0 1 0;
#X connect 12 0 4 0;
#X restore 115 484 pd SERVO;
#X text 191 485 <- example of Servo control;
#X text 191 533 <- example of switching inputs on and off (optional)
;
#X text 191 364 <- first \, you need to config the pinMode;
#N canvas 41 177 444 293 PINMODE 0;
#X text 45 14 Before you can send or receive any data from the Arduino
\, you need to configure the pins using the pinMode message. The message
has the format [pinMode pin# mode(. You can use either numbers or names
for the pin modes:;
#X msg 58 171 pinMode 10 3;
#X msg 58 151 pinMode 10 2;
#X msg 58 131 pinMode 10 1;
#X msg 58 111 pinMode 10 0;
#X msg 58 191 pinMode 10 4;
#X text 169 111 ==;
#X text 169 131 ==;
#X text 169 151 ==;
#X text 169 171 ==;
#X text 169 191 ==;
#X msg 218 111 pinMode 10 input;
#X msg 218 131 pinMode 10 output;
#X msg 218 151 pinMode 10 analog;
#X msg 218 171 pinMode 10 pwm;
#X msg 218 191 pinMode 10 servo;
#X restore 104 363 pd PINMODE;
#X text 470 189 <-- set pin 13 to output mode;
#X text 381 222 <-- toggle pin 13 on and off;
#X connect 2 0 21 0;
#X connect 3 0 21 0;
#X connect 20 0 27 0;
#X connect 25 0 18 0;
#X connect 26 0 25 0;
#X connect 27 0 19 0;
#X connect 28 0 21 0;
#X connect 31 0 21 0;
#X connect 32 0 21 0;
#X connect 36 0 21 0;
#X connect 39 0 18 0;
|