This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Opening and sending numbers to LPT1

Old posts that have not been replied to for several years.
Locked
w
woffer

Post by woffer »

Is it possible with TCL to open and send a 1 (the number 1) to the LPT1 port?
And how ? =)
j
jedis

Post by jedis »

And why would you want to do this?

I doubt anyone will help you if this is possible, that would be very annoying for sysadmin's.
w
woffer

Post by woffer »

Well first of all it's my own machine.. and i'm going to have some LEDs connected to the LPT1 port and i want them to light up at diffrent times using my bots.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Is this for windows or linux?

First step is opening the port:

For DOS/Windows 95/98, this might work:

set fp [open "LPT1:" "r+"]

You might also try \.lpt1 ("\\.\lpt1")

For linux, try /dev/lp0

Then to output the 1... I'm not sure if you meant the string "1" like normal, or binary "1".
string: puts -nonewline $fp "1"
binary: puts -nonewline $fp [binary format c 1]
flush $fp
w
woffer

Post by woffer »

Thanks for the help .. sorry for not telling you all the data/info. I was really tired when i wrote the question.
btw it worked. (i'm runing slackware8.0 on my machine)
Locked