content="Microsoft Word 11">
Private Sub Check1_Click()
If Check1.Value = 1 Then
PortOut &H378, &HFF
Check1.Caption = "Lampu On Semua"
Else
PortOut &H378, &H0
Check1.Caption = "Lampu Off Semua"
End If
End Sub
Private Sub Command1_Click()
Unload Me
MsgBox "Keluar Dari Program"
End Sub
Private Sub Command2_Click()
PortOut &H378, &HFF
End Sub
Private Sub Command3_Click()
PortOut &H378, &H0
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 0 To 7
Image1(i) = Image_On
Image1(i).Tag = 1
Next i
Label1.Caption = " Value = " & Value
PortOut &H378, Value
End Sub
Private Sub HScroll1_Change()
PortOut &H378, Value
End Sub
Private Sub Image1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Image1(Index).Tag = "1" Then
Image1(Index) = Image_Of
Image1(Index).Tag = 0
Else
Image1(Index) = Image_On
Image1(Index).Tag = 1
End If
Label1.Caption = " value = " & Value
PortOut &H378, Value
End Sub
Function Value() As Integer
Dim Nilai, i As Integer
For i = 0 To 7
If Image1(i).Tag = 1 Then
Nilai = Nilai + 2 ^ Image1(i).Index
End If
Next i
Value = Nilai
End Function
Private Sub MSComm1_OnComm()
Dim Buffer As Variant
Select Case MSComm1.CommEvent
Case comEvReceive
If MSComm1.InBufferCount = 3 Then
Buffer = CStr(MSComm1.Input)
If Mid(Buffer, 1, 1) = "0" Then
If Mid(Buffer, 2, 1) = "k" Then
End If
End Sub
Private Sub Timer1_Timer()
'Empty_Buffer = MSComm1.Input
If MSComm1.PortOpen = True Then
Else
'MSComm1.Output = Chr$(Get_Value)
End If
End Sub
Klik ini pada Add modul
Dim Port1 As Integer
Public Declare Sub PortOut Lib "io.dll" (ByVal nPort As Integer, ByVal nData As Byte)
Public Declare Function PortIn Lib "io.dll" (ByVal Port As Integer) As Byte
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 Integer, ByVal Value As Integer)
Public Declare Sub Tunda Lib "io.dll" (ByVal lama As Integer)
terlebih dahulu download io.dll copykan ke folder VB tempat kita bekerja dan di sistim 32
Tidak ada komentar:
Posting Komentar