Option Explicit
Private Declare Function Leer Lib "Inpout32.dll" _
Alias "Inp32" (ByVal PortAddress As Integer) As Byte
Private Declare Sub Escribir Lib "Inpout32.dll" _
Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Byte)
Private Declare Sub Sleep Lib "Kernel32.dll" (ByVal PortAddress As Integer)
Dim dato As Byte
Private Sub Command1_Click()
If IsNumeric(txt) Then dato = CByte(txt) Else GoTo Erroneo
If dato > 255 Or dato < 0 Then
Erroneo:
MsgBox "Ingrese numeros entre 0 - 255"
txt = 0
Else
Escribir &H378, dato
End If
End Sub
Private Sub Form_Load()
Escribir &H378, 0
End Sub