easystepper: very simple 4-wire stepper driver

This commit is contained in:
Daniel Esteban
2019-02-09 20:12:16 +01:00
committed by Ayke van Laethem
parent 4ff437e5d4
commit ae53ea7d81
2 changed files with 106 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package main
import (
"machine"
"time"
"github.com/tinygo-org/drivers/easystepper"
)
func main() {
motor := easystepper.New(machine.P13, machine.P15, machine.P14, machine.P16, 200, 75)
for {
println("CLOCKWISE")
motor.Move(2050)
time.Sleep(time.Millisecond * 1000)
println("COUNTERCLOCKWISE")
motor.Move(-2050)
time.Sleep(time.Millisecond * 1000)
}
}