From bbaf122079a75113418a8720ac922c7d9ac58eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 9 Jun 2010 12:38:06 +0000 Subject: updated reference patch for lpt show how to access the parallel port via devicefiles; show how to set the control bits; show how to read the input pins svn path=/trunk/externals/zexy/; revision=13630 --- reference/lpt-help.pd | 73 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 23 deletions(-) (limited to 'reference') diff --git a/reference/lpt-help.pd b/reference/lpt-help.pd index d9f461d..4d12bc7 100644 --- a/reference/lpt-help.pd +++ b/reference/lpt-help.pd @@ -1,24 +1,12 @@ -#N canvas 173 205 772 508 10; +#N canvas 1387 257 772 508 10; #X text 129 36 write data to the (parallel) port; -#X text 75 390 parallel ports 0 \, 1 \, 2; -#X text 289 394 another port; -#X obj 81 305 % 256; -#X floatatom 81 283 4 0 0 0 - - -; -#X text 122 284 write an 8bit-word; +#X obj 81 355 % 256; +#X floatatom 81 304 4 0 0 0 - - -; +#X text 122 304 write an 8bit-word; #X obj 90 33 lpt; -#X obj 81 337 lpt 1; -#X obj 81 411 lpt 0; -#X obj 120 411 lpt 1; -#X obj 159 411 lpt 2; -#X obj 294 415 lpt 0x378; #X text 521 30 part of zexy; -#X text 82 70 this does not work on osX (as there is no parallel port) +#X text 79 64 this does not work on osX (as there is no parallel port) ; -#X text 79 194 if your port-address exceeds 0x3ff \, "lpt" will try -to get all permissions with the iopl()-command. this might be dangerous -!; -#X text 79 160 you can access all ports on your system when using "lpt -"; #N canvas 0 0 631 406 windows 0; #X text 32 16 To get it running under WinNT/2000/XP a special kernel driver is needed. These systems do not allow direct access to I/O ports. @@ -36,9 +24,48 @@ Click on 'Start' and then 'Exit'.; ../userport; #X text 49 79 downloads:; #X text 267 326 thanks to Olaf Matthes for this; -#X restore 292 94 pd windows; -#X text 78 94 windoze users shoud read this:; -#X text 79 122 linux users might have to be root to get write-permissions -on your specified port.; -#X connect 3 0 7 0; -#X connect 4 0 3 0; +#X restore 292 86 pd windows; +#X text 80 253 you should be member of the "lp" group or set the the +permissions of the device file; +#X obj 81 397 lpt /dev/parport0; +#N canvas 0 0 553 385 raw 0; +#X text 24 127 if your port-address exceeds 0x3ff \, "lpt" will try +to get all permissions with the iopl()-command. this might be dangerous +!; +#X text 26 50 you can access all ports on your system when using "lpt +"; +#X text 26 89 you might have to be root (superuser) \, in order to +gain raw access to the port.; +#X text 75 230 parallel ports 0 \, 1 \, 2; +#X obj 81 251 lpt 0; +#X obj 130 251 lpt 1; +#X obj 179 251 lpt 2; +#X obj 68 329 lpt 0x378; +#X text 63 308 another port (directly specifying the port address) +; +#X restore 460 150 pd raw access; +#X text 78 86 w32 users shoud read this:; +#X text 81 153 linux users can use the deprecated RAW access method +; +#X text 80 219 you can access your parallel ports by accessing /dev/parport0 +(and similar); +#X text 82 189 the preferred way for linux users is to use the device-filesystem: +; +#X text 217 398 <-- access /dev/parport0; +#X obj 84 465 lpt/dev/parports/0; +#X text 222 466 <-- some systems might use this syntax; +#X msg 335 309 control \$1; +#X obj 335 330 % 256; +#X floatatom 335 291 4 0 0 0 - - -; +#X text 373 291 set the control bits; +#X floatatom 81 429 5 0 0 0 - - -; +#X msg 337 363 bang; +#X text 380 367 read the input bits; +#X text 131 429 input bits; +#X connect 1 0 9 0; +#X connect 2 0 1 0; +#X connect 9 0 22 0; +#X connect 18 0 19 0; +#X connect 19 0 9 0; +#X connect 20 0 18 0; +#X connect 23 0 9 0; -- cgit v1.2.1