mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-09 01:13:40 +00:00
easystepper: very simple 4-wire stepper driver
This commit is contained in:
committed by
Ayke van Laethem
parent
4ff437e5d4
commit
ae53ea7d81
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user