Parallel Port Interfacing

Though it is a simple lighting 8 LEDs in parallel port it is 100% working. I just want to convert command buttons into checkboxes so that the user can choose any LED he wants to on/off. I already tried it but I failed. This is my code:


'connection of vb with port
Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal portaddress As Integer) As Integer
Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal portaddress As Integer, ByVal value As Integer)

Dim port1 As Integer

Private Sub Command1_Click()
port1 = 888
Out port1, 1
End Sub

Private Sub Command10_Click()
port1 = 888
Out port1, 255
End Sub

Private Sub Command2_Click()
port1 = 888
Out port1, 2
End Sub

Private Sub Command3_Click()
port1 = 888
Out port1, 4
End Sub

Private Sub Command4_Click()
port1 = 888
Out port1, 8
End Sub

Private Sub Command5_Click()
port1 = 888
Out port1, 16
End Sub

Private Sub Command6_Click()
port1 = 888
Out port1, 32
End Sub

Private Sub Command7_Click()
port1 = 888
Out port1, 64
End Sub

Private Sub Command8_Click()
port1 = 888
Out port1, 128
End Sub

Private Sub Command9_Click()
port1 = 888
Out port1, 0
End Sub

Private Sub Form_Load()
port1 = 888
Out port1, 0
End Sub

-------------------------------------------------------------

please, anyone help me converting it...
Thank you in advance!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories