Evo kako sam to uradio!!!

evo koda
Code:
Private Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)
Private Declare Sub PortWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Integer)
Private Declare Sub PortDWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Long)
Private Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As Byte
Private Declare Function PortWordIn Lib "IO.DLL" (ByVal Port As Integer) As Integer
Private Declare Function PortDWordIn Lib "IO.DLL" (ByVal Port As Integer) As Long
Private Declare Sub SetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Private Declare Sub ClrPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Private Declare Sub NotPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Private Declare Function GetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte) As Boolean
Private Declare Function RightPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Private Declare Function LeftPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Private Declare Function IsDriverInstalled Lib "IO.DLL" () As Boolean
Public Broj, LPTadresa, SPTAdresa As Integer
Private Sub Form_Load()
LPTadresa = &H378
SPTAdresa = LPTadresa + 1
End Sub
Private Sub Option1_Click()
If Option1 Then LPTadresa = &H378
SPTAdresa = LPTadresa + 1
End Sub
Private Sub Option2_Click()
If Option2 Then LPTadresa = &H278
SPTAdresa = LPTadresa + 1
End Sub
Private Sub Option3_Click()
If Option3 Then LPTadresa = &H3BC
SPTAdresa = LPTadresa + 1
End Sub
Private Sub Timer1_Timer()
Dim j As Integer
Dim Broj As Byte
Dim i As Byte
Broj = PortIn(SPTAdresa)
Broj = Broj Xor 128
If GetPortBit(SPTAdresa, 5) Then
Shape2.BackColor = RGB(0, 0, 255)
Else
Shape2.BackColor = RGB(255, 255, 255)
End If
End Sub]