                    lpin by Daniel Muellegger, daniel@muellegger.de
                                 Version 0.1
                                    2006



I used lpswitch by Kai Fett, kf@schnism.net, Version 0.1, 17.8.1998
as base for lpin. Thanks, It helped me to get along with C....

lpin monitors the five input bits of a parallel printer port to use for example switches or relays to controll your PC.

These are:

S3 Pin15
S4 Pin13
S5 Pin12
S6 Pin10
S7 Pin11

These five pins should each be connected via a 4k7 Ohm resistor to Pin1 which pulls them to high potential.
A switch connected to one of the pins an ground (Pin18 - Pin25) can pull them to low potential.
lpin reads the port app. five times per second. If the status of any of these pins changes an accoring script in /usr/local/bin is executed.
The switch between S3 (pin15) and ground closes -> /usr/local/bin/on3 is executed.
The switch between S3 (pin15) and ground opens -> /usr/local/bin/off3 is executed.
For S4 on4 and off4, for s5 on5 and off5........

As long as one the these scrips is running, the execution of lpin stops. So if you want to continue monitoring while an other started program is running, you should start this program in the background.

The base adress for the first parallel port is 0x378. This can be changed in the source code.

For compilation type make.

To install lpin copy it to /usr/local/bin or any other places, where you want to execute it.

Have fun.

If you find lpin usefull or you have ideas to improve it, please use, change it and perhaps write me an email to daniel@muellegger.de.

