I want to do hardware interaction using "C" Program. I have heard that using Printer's port I can create a C Program which can control a "Bulb" or "Tube Light" to on or off. Which means if I press any key from my Keyboard ( Suppose "1" ) then Bulb will be on and from another key I want to off it. How can I achieve this ?
Asked
Active
Viewed 842 times
0
-
By "printer port" you actually mean a parallel port. Not many computers actually have parallel ports these days; they've been superseded by USB. – Wyzard Jan 26 '12 at 04:51
-
1I am using old Dell laptop , Plantium-2 – Lucifer Jan 26 '12 at 04:54
-
@Wyzard: It sounds like he want to bit-bang the parallel port. – leppie Jan 26 '12 at 04:55
-
1Please say something about your operating system, since direct hardware access is not possible in a platform-neutral way in C. – unwind Jan 26 '12 at 08:20
-
I have Win 98 Operating System – Lucifer Jan 26 '12 at 11:44
1 Answers
0
See http://logix4u.net/parallel-port. Since (you say) you’re using Windows 98, their Tutorial on Parallel Port Interfacing will be directly applicable.
If you want to write programs that can be used on later versions of Windows, see also their Inpout32.dll for Windows 98/2000/NT/XP, which claims to be compatible with the programs from the book Parallel Port Complete (see the book’s website for downloadable sample programs).
Another good-looking tutorial/sample for inpout32.dll is at http://www.hytherion.com/beattidp/comput/pport.htm.

J. C. Salomon
- 4,143
- 2
- 29
- 38