Kleiner Code zur Ansteuerung des ministeppers.
Betrieben mit 12V, ist dieser überraschend stark.
Die Getriebeübersetzung und somit 4096 Steps pro Umdrehung machen diesen sehr langsam. (ca 64:1)
Alles anzeigen
Betrieben mit 12V, ist dieser überraschend stark.
Die Getriebeübersetzung und somit 4096 Steps pro Umdrehung machen diesen sehr langsam. (ca 64:1)
Quellcode
- $regfile = "m328pdef.dat" 'Controller
- $crystal = 8000000
- $hwstack = 64
- $swstack = 64
- $framesize = 64 'Quarzfrequenz
- '
- Dim I As Integer
- Dim Wartezeit As Integer
- Config Portd = Output
- Portd.2 = 1
- Portd.3 = 1
- Portd.4 = 1
- Portd.5 = 1
- Wartezeit = 4
- Do
- For I = 7 To 0 Step -1
- If I = 0 Then
- Portd.2 = 0
- Portd.3 = 0
- Portd.4 = 0
- Portd.5 = 1
- Waitms Wartezeit
- End If
- If I = 1 Then
- Portd.2 = 0
- Portd.3 = 0
- Portd.4 = 1
- Portd.5 = 1
- Waitms Wartezeit
- End If
- If I = 2 Then
- Portd.2 = 0
- Portd.3 = 0
- Portd.4 = 1
- Portd.5 = 0
- Waitms Wartezeit
- End If
- If I = 3 Then
- Portd.2 = 0
- Portd.3 = 1
- Portd.4 = 1
- Portd.5 = 0
- Waitms Wartezeit
- End If
- If I = 4 Then
- Portd.2 = 0
- Portd.3 = 1
- Portd.4 = 0
- Portd.5 = 0
- Waitms Wartezeit
- End If
- If I = 5 Then
- Portd.2 = 1
- Portd.3 = 1
- Portd.4 = 0
- Portd.5 = 0
- Waitms Wartezeit
- End If
- If I = 6 Then
- Portd.2 = 1
- Portd.3 = 0
- Portd.4 = 0
- Portd.5 = 0
- Waitms Wartezeit
- End If
- If I = 7 Then
- Portd.2 = 1
- Portd.3 = 0
- Portd.4 = 0
- Portd.5 = 1
- Waitms Wartezeit
- End If
- If I = 1 Then
- Portd.2 = 0
- Portd.3 = 0
- Portd.4 = 0
- Portd.5 = 0
- Waitms Wartezeit
- End If
- Next
- Loop
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von sk8erboi ()