It's not that hard. To control hardware with your lpt1 port you do this
here an image from your lpt1 port:
here some information:
Pin-nummer - Uitgang - Waarde
2 - D0 - 1
3 - D1 - 2
4 - D2 - 4
5 - D3 - 8
6 - D4 - 16
7 - D5 - 32
8 - D6 - 64
9 - D7 - 128
18 = mass
here the circuit:
the end that says 'data' you connect with the pin (2,3,4,5,6,7,8,9) and the '-' you connect with the mass (18).
So you can make this 8 times and connect the 'data' line to a new pin and the '-' everytime to the mass (18).
The you can connect every hardware that works in the range of 9-12V. The power source of the hardware you connect with the + and the - with the end of the hardware (i hope you understand, otherwise just ask).
-------------------------------------------
now the software part:
First you have to donload io.dll, i included it.
Download io.dll
Mirror 1
Then include it in your project.
+++++
Here some functions you can then use:
PortOut
Outputs a byte to the specified port.
PortWordOut
Outputs a word (16-bits) to the specified port.
PortDWordOut
Outputs a double word (32-bits) to the specified port.
PortIn
Reads a byte from the specified port.
PortWordIn
Reads a word (16-bits) from the specified port.
PortDWordIn
Reads a double word (32-bits) from the specified port.
SetPortBit
Sets the bit of the specified port.
ClrPortBit
Clears the bit of the specified port.
NotPortBit
Nots (inverts) the bit of the specified port.
GetPortBit
Returns the state of the specified bit.
RightPortShift
Shifts the specified port to the right. The LSB is returned, and the value passed becomes the MSB.
LeftPortShift
Shifts the specified port to the left. The MSB is returned, and the value passed becomes the LSB.
IsDriverInstalled
Returns non-zero if io.dll is installed and functioning. The primary purpose of this function is to ensure that the kernel mode driver for NT/2000/XP has been installed and is accessible.
+++++
I only used this function:
Call PortOut(888, 255)
The 888 stands for lpt port 1.
The 255 for the pins you turned on, if you want to turn on all the pins you dot his:
1+2+4+8+16+32+64+128=255
If you want to turn on pin 4 and 6:
4+16=20
so: Call PortOut(888, 20)
I hope I made it clear for you
If you have any questions just ask.
Greetz Themuzz