-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomport.pat
350 lines (350 loc) · 9.22 KB
/
comport.pat
1
max v2;#N vpatcher 346 44 1353 951;#P origin 41 2;#P window setfont "Sans Serif" 9.;#P newex 704 88 20 196617 t b;#P newex 390 31 294 196617 patcherargs @token "13 10" @baud 9600 @watch 1 @listports;#P newex 666 65 126 196617 route token listports done;#P inlet 202 200 15 0;#P message 742 89 33 196617 set 3;#P newex 202 258 62 196617 prepend set;#P comment 289 97 100 196617 << Is Writing;#P button 271 97 15 0;#P comment 289 77 100 196617 << Is Reading;#P button 271 77 15 0;#P comment 288 55 100 196617 << Is watching;#P button 270 55 15 0;#P message 55 195 52 196617 watch \$1;#P toggle 270 35 15 0;#P objectname toggle[2];#N comlet Is Writing;#P outlet 594 740 15 0;#N comlet Is Reading;#P outlet 558 787 15 0;#N vpatcher 10 59 224 345;#P window setfont "Sans Serif" 9.;#P hidden newex 55 113 29 196617 gate;#P hidden newex 57 50 27 196617 t i i;#P hidden newex 50 83 27 196617 > 0;#P hidden newex 55 139 20 196617 t b;#P inlet 57 30 15 0;#P outlet 55 161 15 0;#P connect 4 1 3 0;#P connect 3 0 5 0;#P connect 5 0 2 0;#P connect 2 0 0 0;#P connect 1 0 4 0;#P connect 4 0 5 1;#P pop;#P newobj 558 760 67 196617 p detectRead;#P newex 194 229 68 196617 prepend open;#P toggle 356 356 15 0;#P objectname toggle[1];#P button 628 745 15 0;#P button 585 787 15 0;#N vpatcher 1189 44 1800 620;#P window setfont "Sans Serif" 9.;#P window linecount 1;#P newex 182 506 40 196617 change;#P number 171 443 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;#P newex 269 415 27 196617 0;#P newex 236 379 51 196617 sel 1;#P window linecount 0;#P newex 189 415 55 196617 delay 200;#P window linecount 1;#N vpatcher 10 59 272 488;#P window setfont "Sans Serif" 9.;#P window linecount 1;#P newex 120 273 32 196617 sel 1;#P newex 120 240 30 196617 >= 2;#P newex 50 220 44 196617 zl nth 1;#P message 57 295 67 196617 usbserial-AH01DOT8;#P newex 51 246 62 196617 prepend set;#P newex 117 203 34 196617 zl len;#P message 144 124 38 196617 usbserial-AH01DOT8;#P newex 75 50 40 196617 t b s s;#P newex 123 87 62 196617 prepend set;#P newex 110 152 44 196617 zl union;#P inlet 75 30 15 0;#P outlet 120 262 15 0;#P outlet 57 315 15 0;#P window linecount 0;#P comment 92 333 100 196617 detect change in symbol // [email protected] 2013;#P connect 4 0 11 0;#P connect 11 0 9 0;#P connect 13 0 10 0;#P connect 9 0 10 0;#P connect 10 0 1 0;#P connect 3 0 6 0;#P connect 6 2 4 0;#P connect 4 0 8 0;#P connect 8 0 12 0;#P connect 12 0 2 0;#P connect 12 0 13 0;#P connect 6 1 5 0;#P connect 6 0 7 0;#P connect 5 0 7 0;#P connect 7 0 4 1;#P pop;#P newobj 237 345 88 196617 p change(symbol);#P number 234 479 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;#P newex 482 102 56 196617 route port;#P inlet 482 77 15 0;#P newex 483 358 78 196617 prepend append;#P newex 483 327 47 196617 zl iter 1;#P newex 348 193 21 196617 t 0;#P newex 310 194 21 196617 t 1;#P newex 34 102 428 196617 route listports open close;#P newex 203 273 48 196617 loadbang;#P newex 173 373 31 196617 == 1;#P newex 173 346 34 196617 zl len;#P objectname theserial[4];#P message 203 297 168 196617 port "--- Choose a serial port ---";#P newex 173 319 40 196617 zl sect;#P objectname theserial[3];#P newex 173 228 67 196617 prepend port;#P inlet 30 40 15 0;#P outlet 35 427 15 0;#P outlet 483 436 15 0;#P outlet 173 534 15 0;#P window linecount 0;#P message 76 196 206 196617 clear \, append "--- Choose a serial port ---";#P newex 37 163 30 196617 t b b;#P message 37 195 32 196617 print;#P connect 6 0 13 0;#P connect 7 0 5 0;#P connect 0 0 5 0;#P connect 13 0 1 0;#P connect 1 0 0 0;#P connect 1 1 2 0;#P connect 22 0 25 0;#P connect 11 0 25 0;#P connect 13 1 7 0;#P connect 7 0 8 0;#P connect 8 0 10 0;#P connect 10 0 11 0;#P connect 26 0 3 0;#P connect 20 0 26 0;#P connect 23 0 22 0;#P connect 12 0 9 0;#P connect 9 0 8 1;#P connect 25 0 20 0;#P connect 15 0 20 0;#P connect 24 0 20 0;#P connect 21 1 23 0;#P connect 13 1 21 0;#P connect 23 0 24 0;#P connect 13 2 15 0;#P connect 18 0 19 0;#P connect 19 0 16 0;#P connect 16 0 17 0;#P connect 17 0 4 0;#P connect 2 0 4 0;#P pop;#P newobj 161 286 326 196617 p handlePort;#N vpatcher 206 774 427 992;#P window setfont "Sans Serif" 9.;#P newex 140 50 30 196617 t b s;#P newex 54 67 62 196617 prepend set;#P newex 37 39 68 196617 prepend baud;#P message 54 107 76 196617 baud 9600;#P inlet 140 28 15 0;#P inlet 37 19 15 0;#P outlet 37 179 15 0;#P connect 1 0 4 0;#P connect 4 0 0 0;#P connect 6 1 0 0;#P connect 3 0 0 0;#P connect 4 0 5 0;#P connect 6 0 3 0;#P connect 5 0 3 0;#P connect 2 0 6 0;#P pop;#P newobj 73 357 98 196617 p handleBaud;#N vpatcher 442 764 668 1038;#P toggle 100 54 15 0;#P toggle 22 53 15 0;#P outlet 115 156 15 0;#P toggle 115 135 15 0;#P window setfont "Sans Serif" 9.;#P newex 50 49 27 196617 > 0;#P newex 51 75 27 196617 t b i;#P objectname theserial[2];#P newex 51 104 27 196617 &;#P objectname theserial[1];#P newex 51 134 56 196617 metro 40;#P objectname theserial[10];#P inlet 92 30 15 0;#P inlet 50 29 15 0;#P outlet 51 156 15 0;#P connect 1 0 9 0;#P connect 1 0 6 0;#P connect 6 0 5 0;#P connect 2 0 4 0;#P connect 5 0 4 0;#P connect 4 0 3 0;#P connect 3 0 0 0;#P connect 5 1 4 1;#P connect 2 0 10 0;#P connect 4 0 7 0;#P connect 7 0 8 0;#P pop;#P newobj 255 410 73 196617 p handleWatch;#N vpatcher 20 74 394 494;#P origin 10 0;#P window setfont "Sans Serif" 9.;#P window linecount 1;#P newex 179 51 30 196617 t s s;#P newex 249 123 64 196617 fromsymbol;#P newex 177 125 64 196617 fromsymbol;#P number 116 116 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;#P newex 267 191 68 196617 loadmess set;#P window linecount 0;#P message 248 235 16 196617 13 10;#P window linecount 1;#P newex 249 157 62 196617 prepend set;#P window linecount 0;#P message 177 234 37 196617 13 10;#P window linecount 1;#P newex 177 199 32 196617 sel 0;#P newex 177 160 34 196617 zl len;#P inlet 178 30 15 0;#P newex 177 273 47 196617 zl iter 1;#P window linecount 0;#P newex 79 321 27 196617 i;#P newex 53 43 30 196617 t b s;#P newex 78 211 31 196617 spell;#P inlet 53 23 15 0;#P outlet 79 343 15 0;#P connect 1 0 3 0;#P connect 3 1 2 0;#P connect 5 0 4 0;#P connect 2 0 4 0;#P connect 4 0 0 0;#P connect 7 0 13 0;#P connect 16 0 14 0;#P connect 14 0 7 0;#P connect 7 0 8 0;#P connect 8 0 9 0;#P connect 11 0 5 0;#P connect 9 0 5 0;#P connect 6 0 16 0;#P connect 3 0 11 0;#P connect 12 0 11 0;#P connect 8 1 11 0;#P connect 10 0 11 0;#P connect 16 1 15 0;#P connect 15 0 10 0;#P pop;#P newobj 76 441 78 196617 p append_token;#P inlet 29 194 15 0;#P newex 29 229 143 196617 route send baud watch;#N comlet Response;#P outlet 29 822 15 0;#N comlet Available Ports;#P outlet 833 417 15 0;#N vpatcher 1487 515 1729 776;#P window setfont "Sans Serif" 9.;#P window linecount 0;#P message 50 103 57 196617 bang \, clear;#P newex 66 133 77 196617 loadmess clear;#P outlet 50 194 15 0;#P newex 50 168 151 196617 itoa;#P window linecount 1;#P newex 50 75 20 196617 t b;#P newex 50 50 81 196617 route 13 10;#P inlet 50 30 15 0;#P connect 0 0 1 0;#P connect 1 0 2 0;#P connect 2 0 6 0;#P connect 5 0 3 0;#P connect 6 0 3 0;#P connect 3 0 4 0;#P connect 1 2 3 1;#P pop;#P newobj 29 758 107 196617 p bufferuntil_linefeed;#P newex 557 686 85 196617 route read write;#P message 704 109 49 196617 listports;#P user umenu 161 35 100 196647 1 64 51 1;#X add 1200;#X add 2400;#X add 4800;#X add 9600;#X add 19200;#X add 31250;#X add 38400;#X add 57600;#X add 115200;#X add 128000;#X add 153600;#X add 230400;#X add 256000;#X add 460800;#X add 921600;#P objectname umenu[1];#P user umenu 1 35 156 196647 1 64 51 1;#X add "--- Choose a serial port ---";#X add Bluetooth-PDA-Sync;#X add Bluetooth-Modem;#X add PL2303-0010121A;#P objectname umenu;#P number 12604 109 8295 9 0 0 -9328 3 0 0 0 221 221 221 222 222 222 0 0 0;#P objectname test;#P newex 29 612 552 196617 serial;#P objectname theserial;#P newex 594 716 20 196617 t b;#P window linecount 2;#P comment 2 53 214 196617 comport abstraction by jens alexander ewald // lea.io copyleft 2012-2013;#P toggle 343 448 15 0;#P objectname toggle;#N comlet Connected;#P outlet 320 469 15 0;#P button 254 449 15 0;#P window linecount 1;#P comment 288 35 100 196617 << Watch Port;#P connect 20 2 8 0;#P connect 40 1 15 0;#P connect 29 0 15 0;#P connect 16 0 15 0;#P connect 10 0 15 0;#P connect 18 0 6 0;#P connect 19 0 6 0;#P connect 17 0 6 0;#P connect 6 0 12 0;#P connect 12 0 14 0;#P connect 28 0 29 0;#P connect 15 1 19 0;#P connect 9 1 19 0;#P connect 15 0 17 0;#P connect 39 0 17 1;#P connect 37 0 9 0;#P connect 24 0 20 0;#P connect 15 3 20 0;#P connect 20 0 19 1;#P connect 8 1 24 0;#P connect 38 0 24 0;#P connect 15 2 36 0;#P connect 18 0 1 0;#P connect 15 2 18 0;#P connect 36 0 28 0;#P connect 18 0 30 0;#P connect 25 0 32 0;#P connect 5 0 34 0;#P connect 20 1 18 1;#P connect 18 1 2 0;#P connect 18 1 3 0;#P connect 20 1 23 0;#P fasten 6 1 20 1 606 659 865 646 939 389 906 214 715 116 516 168 495 241;#P connect 6 1 11 0;#P connect 11 0 25 0;#P connect 25 0 26 0;#P connect 25 0 21 0;#P connect 11 1 5 0;#P connect 5 0 27 0;#P connect 5 0 22 0;#P connect 40 1 39 0;#P connect 39 1 41 0;#P connect 41 0 10 0;#P connect 39 2 37 0;#P connect 20 2 13 0;#P pop;