LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-06-2005, 12:45 PM   #1
Nerox
Member
 
Registered: Jul 2004
Location: Spain
Posts: 111

Rep: Reputation: 20
Programming the parallel port via /dev/lp0


Hi there, does anybody here know how to read and write from/to the parallel port using /dev/lp0? I know i can use /dev/port instead, but it refers to all ports.

TIA
 
Old 01-07-2005, 03:33 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
Several ways to access the parallel port are discussed in http://www.tldp.org/HOWTO/IO-Port-Programming.html

Basically, if you ignore the handshaking, then bytes written to lp0 will appear on the port, and bytes read from it will return the values on the port. More complex issues, such as setting the port to be an input, or changing the handshake modes, are in the HOWTO.
 
Old 01-08-2005, 04:00 AM   #3
Nerox
Member
 
Registered: Jul 2004
Location: Spain
Posts: 111

Original Poster
Rep: Reputation: 20
I know the HOWTO, there is nothing about how to read and write from/to /dev/lp0. Do you know how to do that?

Thank you
 
Old 01-09-2005, 05:25 AM   #4
Genjix
Member
 
Registered: Oct 2003
Location: Pico
Distribution: SUSE 9.1
Posts: 83

Rep: Reputation: 15
echo -en "Hello, World!!!" > /dev/lp0
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/dev/lp0 doesn't exists conio Linux - Hardware 26 01-12-2013 11:28 AM
Why no /dev/lp0 in CUPS sharper Slackware 0 12-25-2004 07:19 PM
/dev/lp0 not recognized tiagobt Linux - General 8 09-27-2004 01:26 PM
Missing /dev/lp0 (parallell port) ??? comawhite Debian 1 09-25-2003 07:40 AM
Redirection > /dev/lp0 XT8088 Linux - Newbie 2 09-20-2003 06:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration