Dim a As Long, b As Long, c As Long, d As Long, e As Long, f As Long, Pulses
Private Sub Command1_Click()
Timer1.Interval = Val(Text2.Text) ' Set interval.
End Sub
Private Sub Command2_Click()
Unload Form1
End
End Sub
Private Sub Form_Load()
Text2.Text = 0
Text1.Text = 0
a = RGB(255, 255, 255) ' White Wait = Interval / 10
b = RGB(255, 0, 0) ' Red Enable Pin ON
c = RGB(0, 0, 255) ' Blue Set direction CW or CCW
d = RGB(255, 0, 255) ' Lila Pulse => ON, wait 1, Pulse OFF, wait 3
e = RGB(255, 255, 0) ' Yellow Enable OFF
f = RGB(0, 0, 0) ' Black Wait = Interval - (suma time a - e)
End Sub
Private Sub Picture1_Click()
End Sub
Private Sub Text1_Change()
' future Restriction = just whole numbers > 0, max Value 25
If Text1.Text > 0 Then Text2.Enabled = True
End Sub
Private Sub Text2_Change()
' future Restriction = just numbers > 0,
' if "," instead "." then MsgBox with Warning,
' max lenght = 7
If Text2.Text > 0 Then Command1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If Picture1.BackColor = c Then
For Pulses = 0 To Val(Text1.Text) Step 1
Timer1.Interval = Val(Text2.Text) * Val(Text1.Text)
Exit For
Pulses = Val(Text1.Text)
Next Pulses
Else
Timer1.Interval = Val(Text2.Text)
End If
If Picture1.BackColor = a Then
Picture1.BackColor = b
ElseIf Picture1.BackColor = b Then
Picture1.BackColor = c
ElseIf Picture1.BackColor = c Then
Picture1.BackColor = d
ElseIf Picture1.BackColor = d Then
Picture1.BackColor = e
ElseIf Picture1.BackColor = e Then
Picture1.BackColor = f
Else
Picture1.BackColor = a
Timer1.Interval = Val(Text2.Text) / 2
End If
End Sub
Lesezeichen