Sei sulla pagina 1di 1

Private Declare Function Inp Lib "inpout32.

dll" Alias "Inp32" (ByVal PortAddress As Integer) As Integer Private Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As I nteger, ByVal Value As Integer) Private Sub Form_Load() Out "&H378", 0 End Sub Private Sub Led_Click(Index As Integer) If Led(Index).Caption = "0" Then Led(Index).Caption = "1" Else Led(Index).Caption = "0" End If lblValor.Caption = (Led(0).Caption) * 2 ^ 0 + (Led(1).Caption) * 2 ^ 1 + (Led(2) .Caption) * 2 ^ 2 + (Led(3).Caption) * 2 ^ 3 + (Led(4).Caption) * 2 ^ 4 + (Led(5 ).Caption) * 2 ^ 5 + (Led(6).Caption) * 2 ^ 6 + (Led(7).Caption) * 2 ^ 7 Out "&H378", Val(lblValor.Caption) End Sub

Potrebbero piacerti anche