Private Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
Dim i As Integer
Dim StepSelect As Integer
Dim Lefts, Rights As Boolean
Private Sub cmdBreak_Click()
Rights = True
Lefts = True
Out &H378, &H3
End Sub
Private Sub cmdLeft_Click()
Lefts = False
Rights = True
Select Case StepSelect
Case 0 '?????????????????????????????
Do
DoEvents
Out &H378, 1
Call Delay
Out &H378, 2
Call Delay
Out &H378, 4
Call Delay
Out &H378, 8
Call Delay
Loop Until Lefts = True
Case 1 ''???????????????????????????
Do
DoEvents
Out &H378, 9
Call Delay
Out &H378, 3
Call Delay
Out &H378, 6
Call Delay
Out &H378, 12
Call Delay
Loop Until Lefts = True
Case 2 '????????????????????????
Do
DoEvents
Out &H378, 8
Call Delay
Out &H378, 12
Call Delay
Out &H378, 4
Call Delay
Out &H378, 6
Call Delay
Out &H378, 2
Call Delay
Out &H378, 3
Call Delay
Out &H378, 1
Call Delay
Out &H378, 9
Call Delay
Out &H378, 0
Loop Until Lefts = True
End Select
End Sub
Private Sub cmdRight_Click()
Lefts = True
Rights = False
Select Case StepSelect
Case 0 '?????????????????????????????
Do
DoEvents
Out &H378, 8
Call Delay
Out &H378, 4
Call Delay
Out &H378, 2
Call Delay
Out &H378, 1
Call Delay
Loop Until Rights = True
Case 1 '???????????????????????????
Do
DoEvents
Out &H378, 12
Call Delay
Out &H378, 6
Call Delay
Out &H378, 3
Call Delay
Out &H378, 9
Call Delay
Loop Until Rights = True
Case 2 '????????????????????????
Do
DoEvents
Out &H378, 9
Call Delay
Out &H378, 1
Call Delay
Out &H378, 3
Call Delay
Out &H378, 2
Call Delay
Out &H378, 6
Call Delay
Out &H378, 4
Call Delay
Out &H378, 12
Call Delay
Out &H378, 8
Call Delay
Out &H378, 0
Loop Until Rights = True
End Select
End Sub
Private Sub Form_Load()
StepSelect = 0
End Sub
Sub Delay()
For i = 1 To HScrollBar.Value
DoEvents
Next i
End Sub
Private Sub OptSelect_Click(Index As Integer)
Rights = True
Lefts = True
Out &H378, &H3
StepSelect = Index
End Sub