Files
drivers/examples/easystepper/main.go
T
2019-05-29 13:33:50 +02:00

23 lines
365 B
Go

package main
import (
"machine"
"time"
"tinygo.org/x/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)
}
}