-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpdfirmata-help.pd
327 lines (327 loc) · 11.3 KB
/
pdfirmata-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
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
#N canvas 563 220 677 465 12;
#X obj 32 222 pdfirmata;
#X obj 116 222 comport 1 57600;
#X obj 79 348 pdfirmata;
#X text 19 319 Command In;
#X text 136 320 RAW In;
#X text 138 371 RAW Out;
#X text 21 372 Response Out;
#X obj 32 183 r firmatacmd;
#N canvas 265 151 520 300 pinMode 0;
#X msg 27 35 pinMode 13 INPUT;
#X msg 27 65 pinMode 13 OUTPUT;
#X msg 27 98 pinMode 13 ANALOG;
#X msg 27 128 pinMode 13 PWM;
#X msg 178 35 pinMode 13 SERVO;
#X msg 178 65 pinMode 13 SHIFT;
#X msg 178 98 pinMode 13 I2C;
#X msg 178 128 pinMode 13 ONEWIRE;
#X msg 328 34 pinMode 13 STEPPER;
#X msg 328 63 pinMode 13 ENCODER;
#X msg 328 97 pinMode 13 SERIAL;
#X msg 328 127 pinMode 13 PULLUP;
#X obj 168 203 s pdfirmatacmd;
#X connect 0 0 12 0;
#X connect 1 0 12 0;
#X connect 2 0 12 0;
#X connect 3 0 12 0;
#X connect 4 0 12 0;
#X connect 5 0 12 0;
#X connect 6 0 12 0;
#X connect 7 0 12 0;
#X connect 8 0 12 0;
#X connect 9 0 12 0;
#X connect 10 0 12 0;
#X connect 11 0 12 0;
#X restore 543 172 pd pinMode;
#X msg 34 52 digitalWrite 13 0;
#X msg 34 79 digitalWrite 13 1;
#X obj 34 112 s firmatacmd;
#X msg 202 77 analogWrite 11 \$1;
#X obj 205 49 hsl 128 15 0 255 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 0 1;
#X obj 202 114 s firmatacmd;
#X msg 381 77 analogIn 0 1;
#X msg 381 51 analogIn 0 0;
#X obj 381 118 s firmatacmd;
#X text 24 25 digitalWrite PIN STATE;
#X text 196 25 analogWrite PIN VALUE;
#X text 366 25 analogIn PIN ENABLE?;
#X obj 544 118 s firmatacmd;
#X obj 32 254 print;
#N canvas 1117 193 531 656 serial 0;
#X msg 18 75 serial config HW0 115200 4 5;
#X text 15 31 serial config PORT BAUD (RX) (TX);
#X text 16 52 RX and TX is optional and platform specific;
#X msg 18 132 serial print HW0 Hello World!;
#X text 16 109 serial print PORT SYM0 (SYM1) (SYM2) ...;
#X msg 17 189 serial println HW0 Hello World!;
#X text 15 168 serial println PORT SYM0 (SYM1) (SYM2) ...;
#X text 16 222 serial write PORT BYTE0 (BYTE1) (BYTE2) ...;
#X msg 18 243 serial write HW0 72 101 108 108 111 32 87 111 114 108
100 33 10;
#X text 17 293 serial read PORT READMODE (MAXBYTES);
#X msg 19 332 serial read HW0 0 16;
#X text 18 311 READMODE -> 0 : Continuous \, 1 : Stop after read;
#X text 17 367 serial reply PORT BYTE0 (BYTE1) (BYTE2) ...;
#X msg 19 390 serial reply HW0 72 101 108 108 111 32 87 111 114 108
100 33 10;
#X text 17 435 serial close PORT;
#X msg 19 455 serial close HW0;
#X text 163 433 serial flush PORT;
#X msg 165 453 serial flush HW0;
#X text 304 431 serial listen PORT;
#X msg 306 451 serial listen HW0;
#X text 18 518 Note: Please be careful while sending print \, println
\, write and reply commands. Don't exceed Arduino's serial buffer limit.
Each character takes 2 byte \, maximum character limit is (MAX_BUFFER
- 5) / 2 Default value of the MAX_BUFFER is 64 byte https://github.com/arduino/ArduinoCore-avr/blob/3055c1efa3c6980c864f661e6c8cc5d5ac773af4/cores/arduino/HardwareSerial.h#L42
;
#X restore 543 205 pd serial;
#N canvas 1187 362 493 362 I2C 0;
#X text 19 41 ADDRESS can be either 7-bit (< 128) or 10-bit (< 1024)
;
#X text 19 58 AUTORESTART -> 0 : Stop \, 1 : Restart;
#X msg 23 111 I2C rw 36 0 wr 42 75 89 123;
#X text 18 23 I2C rw ADDRESS AUTORESTART RWMODE BYTE0 (BYTE1) (BYTE2)
...;
#X text 21 151 I2C reply ADDRESS REGADDRESS BYTE0 (BYTE1) (BYTE2) ...
;
#X msg 24 175 I2C reply 36 812 42 75 89 123;
#X text 22 217 I2C config BYTE0 (BYTE1) (BYTE2) ...;
#X msg 23 243 I2C config 12 123 53 23;
#X text 22 280 I2C delay DELAY;
#X msg 23 306 I2C delay 100;
#X text 19 75 READMODE -> wr : Write \, ro : Read Only \, rc : Read
Continuously \, sr : Stop Reading;
#X restore 543 238 pd I2C;
#N canvas 1210 376 450 300 servo 0;
#X text 29 28 servo config PIN MINPULSE MAXPULSE;
#X msg 32 53 servo config 13 500 2500;
#X text 28 101 servo write PIN VALUE;
#X msg 30 142 servo write 13 90;
#X text 27 119 if VALUE < 500 it's angle otherwise pulse duration;
#X restore 543 271 pd servo;
#N canvas 1081 301 451 360 encoder 0;
#X msg 25 58 encoder attach 0 12 13;
#X text 23 15 encoder attach ENCODER PINA PINB;
#X text 23 35 ENCODER is Encoder number. Up to MAX_ENCODERS - 1;
#X msg 25 105 encoder read 0;
#X text 22 84 encoder read ENCODER;
#X text 22 131 encoder readAll;
#X msg 25 152 encoder readAll;
#X text 22 178 encoder reset ENCODER;
#X msg 24 199 encoder reset 0;
#X text 21 222 encoder report ENCODER;
#X msg 23 243 encoder report 0;
#X text 21 268 encoder detach ENCODER;
#X msg 23 289 encoder detach 0;
#X restore 543 307 pd encoder;
#N canvas 65 33 981 549 stepper 0;
#X text 21 20 stepper config motor interface step enable pin1 pin2
(pin3) (pin4) (enablePin) (invert);
#X text 22 51 motor -> 0-9 (Supports up to 10 motors);
#X text 20 68 interface -> 1 : Driver \, 2 : two wire \, 3 : three
wire \, 4 : four wire;
#X text 21 98 step size -> 0 : whole step \, 1 : half step \, 2 : quarter
step etc. (1 / (2^step size));
#X text 21 129 enable -> 0 : no enable pin \, 1 : has enable pin;
#X text 21 147 pin1 -> if interface driver step pin else pin 1;
#X text 21 165 pin2 -> if interface driver direction pin else pin 2
;
#X text 21 182 pin3 -> if interface is three wire or four wire \, optional
;
#X text 21 198 pin4 -> if interface is four wire \, optional;
#X text 20 215 enable pin -> optional;
#X text 19 233 invert -> 1 : invert pin 1 \, 2 : invert pin 2 \, 4
: invert pin 3 \, 8 : invert pin 4 \, 16 : invert enable pin (for example
inverting pin 1 \, pin 3 and enable pin send 1 + 4 + 16 = 21);
#X msg 22 284 stepper config 0 0 4 1 2 3 4;
#X msg 22 335 stepper zero 0;
#X msg 22 384 stepper step 0 500;
#X msg 483 39 stepper to 0 200;
#X msg 483 88 stepper enable 0 1;
#X msg 482 135 stepper stop 0;
#X text 480 158 stepper position motor (report motor position);
#X text 480 113 stepper stop motor (stop currently running motor);
#X text 481 66 stepper enable motor state (0 : disable \, 1 : enable)
;
#X text 21 362 stepper step motor numOfSteps (signed 32-bit);
#X text 481 17 stepper to motor absolutePosition (signed 32-bit);
#X text 20 313 stepper zero motor (send motor to zero position);
#X msg 482 180 stepper position 0;
#X text 479 206 stepper limit motor lowerLimitPin lowerLimitState upperLimitPin
upperLimitState (not yet implemented in firmata);
#X msg 482 255 stepper limit 4 1 5 0;
#X msg 482 353 stepper speed 0 60.75;
#X msg 482 309 stepper acceleration 0 82.33;
#X text 480 277 stepper acceleration motor accelerationStepsInSec (can
be float);
#X text 481 332 stepper speed motor maximumSpeed (can be float);
#X text 221 425 Note about 32-bit values: pure-data using 32-bit floating
point numbers and this type cannot represent every integer bigger than
24-bit. It's possible to increase floating point precision but I think
it's not required for most of the cases.;
#X restore 543 341 pd stepper;
#X text 252 395 for more information about protocol https://github.com/firmata/protocol
;
#N canvas 1116 247 495 284 multiStepper 0;
#X text 26 13 multistepper config group motor1 motor2 (motor3) (motor4)
...;
#X text 25 45 group -> group id. Up to 5 (0-4);
#X msg 27 69 multistepper config 0 0 5 7 9;
#X msg 27 153 multistepper to 0 200;
#X text 26 99 multistepper to group position1 (position2) (position3)
...;
#X text 26 182 multistepper stop group;
#X msg 27 203 multistepper stop 0;
#X text 25 120 add position for each motor in the group. all motors
will arrive desired positions at the same time;
#X restore 542 371 pd multiStepper;
#N canvas 1190 197 676 642 onewire 0;
#X text 25 16 onewire search;
#X text 25 35 search all onewire devices connected to pin;
#X msg 28 59 onewire search;
#X text 26 94 onewire alarmed;
#X text 26 114 search all alarmed onewire devices connected to pin
;
#X msg 28 137 onewire alarmed;
#X text 26 169 onewire config pin power;
#X text 26 187 power -> 0 : leave pin to high after write \, 1 : don't
leave pin to high after write;
#X msg 28 224 onewire config 5 0;
#X text 26 254 onewire reset pin;
#X msg 28 276 onewire reset 5;
#X text 26 306 onewire skip pin;
#X msg 28 328 onewire skip 5;
#X text 26 358 onewire select pin addressByte0 addressByte1 addressByte2
addressByte3 addressByte4 addressByte5 addressByte6 addressByte7;
#X text 26 431 onewire read pin numOfBytes correlationID;
#X msg 29 451 onewire read 5 12 1;
#X text 26 478 onewire delay pin delay;
#X msg 29 500 onewire delay 5 100;
#X text 27 529 onewire write pin byte0 (byte1) (byte2) ...;
#X msg 27 551 onewire write 5 2 7 82 64 122 192;
#X msg 28 406 onewire select 5 12 224 62 16 5 155 8 105;
#X restore 542 406 pd onewire;
#X msg 254 163 version;
#X msg 254 186 firmware;
#X msg 254 209 capability;
#X msg 254 232 sampling 30;
#X obj 254 280 s firmatacmd;
#X text 237 362 https://github.com/NullMember/PDFirmata;
#X msg 380 183 digitalIn 0 1;
#X obj 380 234 s firmatacmd;
#X text 367 153 digitalIn PORT ENABLE?;
#X msg 254 256 analogMap;
#X msg 544 54 pinState 13;
#X text 542 25 pinState PIN;
#X obj 80 255 s firmataResponse;
#N canvas 98 153 450 531 digitalInResponse 0;
#X obj 33 22 r firmataResponse;
#X obj 33 56 route digitalIn;
#X obj 33 80 route 0;
#X text 156 56 digitalIn response;
#X text 158 83 Port 0;
#X obj 33 184 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 33 143 & 1;
#X obj 85 119 >> 1;
#X obj 85 143 & 1;
#X obj 139 143 & 1;
#X obj 191 143 & 1;
#X obj 241 143 & 1;
#X obj 293 143 & 1;
#X obj 347 143 & 1;
#X obj 399 143 & 1;
#X obj 33 119 >> 0;
#X obj 139 119 >> 2;
#X obj 191 119 >> 3;
#X obj 241 119 >> 4;
#X obj 293 119 >> 5;
#X obj 347 119 >> 6;
#X obj 399 119 >> 7;
#X obj 85 184 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 139 184 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 191 184 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 241 185 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 293 185 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 347 185 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X obj 399 185 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X text 29 208 Pin 0;
#X text 83 208 Pin 1;
#X text 136 208 Pin 2;
#X text 190 208 Pin 3;
#X text 238 208 Pin 4;
#X text 292 208 Pin 5;
#X text 345 208 Pin 6;
#X text 399 208 Pin 7;
#X obj 33 277 r firmataResponse;
#X obj 33 301 route digitalIn;
#X obj 33 325 route 0;
#X obj 33 375 >>;
#X floatatom 101 357 5 0 7 0 - - -;
#X obj 33 399 & 1;
#X obj 33 429 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X text 152 301 digitalIn response;
#X text 154 328 Port 0;
#X text 154 357 Pin;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 7 0;
#X connect 2 0 15 0;
#X connect 2 0 17 0;
#X connect 2 0 18 0;
#X connect 2 0 19 0;
#X connect 2 0 20 0;
#X connect 2 0 21 0;
#X connect 6 0 5 0;
#X connect 7 0 8 0;
#X connect 8 0 22 0;
#X connect 9 0 23 0;
#X connect 10 0 24 0;
#X connect 11 0 25 0;
#X connect 12 0 26 0;
#X connect 13 0 27 0;
#X connect 14 0 28 0;
#X connect 15 0 6 0;
#X connect 16 0 9 0;
#X connect 17 0 10 0;
#X connect 18 0 11 0;
#X connect 19 0 12 0;
#X connect 20 0 13 0;
#X connect 21 0 14 0;
#X connect 37 0 38 0;
#X connect 38 0 39 0;
#X connect 39 0 40 0;
#X connect 40 0 42 0;
#X connect 41 0 40 1;
#X connect 42 0 43 0;
#X restore 379 268 pd digitalInResponse;
#X text 248 332 Copyright Malik Enes Safak 2017-2021;
#X connect 0 0 22 0;
#X connect 0 0 43 0;
#X connect 0 1 1 0;
#X connect 1 0 0 1;
#X connect 7 0 0 0;
#X connect 9 0 11 0;
#X connect 10 0 11 0;
#X connect 12 0 14 0;
#X connect 13 0 12 0;
#X connect 15 0 17 0;
#X connect 16 0 17 0;
#X connect 31 0 35 0;
#X connect 32 0 35 0;
#X connect 33 0 35 0;
#X connect 34 0 35 0;
#X connect 37 0 38 0;
#X connect 40 0 35 0;
#X connect 41 0 21 0;