content="Microsoft Word 11">
Private Sub Command1_Click()
HScroll1.Enabled = False
Option1.Enabled = False
Option2.Enabled = False
Command1.Enabled = False
Command2.Tag = "on"
Putar_Motor
'Tunda
End Sub
Private Sub Putar_Motor()
If Option1.Value = True Then
Do
PortOut &H378, 1 'binari = 0001
'Tunda HScroll1.Value
PortOut &H378, 2 'binari = 0010
'Tunda HScroll1.Value
PortOut &H378, 4 'binari = 0100
'Tunda HScroll1.Value
PortOut &H378, 8 'binari = 1000
'Tunda HScroll1.Value
Loop Until Command2.Tag = "off"
Else
Do
PortOut &H378, 8 'binari = 1000
'Tunda HScroll1.Value
PortOut &H378, 4 'binari = 0100
'Tunda HScroll1.Value
PortOut &H378, 2 'binari = 0010
'Tunda HScroll1.Value
PortOut &H378, 1 'binari = 0001
'Tunda HScroll1.Value
Loop Until Command2.Tag = "off"
End If
End Sub
Private Sub Command2_Click()
HScroll1.Enabled = True
Option1.Enabled = True
Option2.Enabled = True
Command1.Enabled = True
Command2.Tag = "off"
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Label1.Caption = HScroll1.Value & "milisekon"
Command2.Tag = "on"
End Sub
Private Sub HScroll1_Change()
Label1.Caption = HScroll1.Value & "milisekon"
End Sub
Klik ini pada Add Modul
Public Declare Sub PortOut Lib "io.dll" (ByVal nPort As Integer, ByVal nData As Byte)
Private Declare Sub Tunda Lib "io.dll" (ByVal lama As Integer)
Tidak ada komentar:
Posting Komentar