mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-21 15:09:00 +00:00
fix type
This commit is contained in:
@@ -7,8 +7,8 @@ import (
|
|||||||
"machine"
|
"machine"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"tinygo.org/x/drivers"
|
|
||||||
"tinygo.org/x/drivers/internal/legacy"
|
"tinygo.org/x/drivers/internal/legacy"
|
||||||
|
"tinygo.org/x/drivers/internal/pin"
|
||||||
)
|
)
|
||||||
|
|
||||||
// New returns a new single easystepper driver given a DeviceConfig
|
// New returns a new single easystepper driver given a DeviceConfig
|
||||||
@@ -17,7 +17,7 @@ func New(config DeviceConfig) (*Device, error) {
|
|||||||
return nil, errors.New("config.StepCount and config.RPM must be > 0")
|
return nil, errors.New("config.StepCount and config.RPM must be > 0")
|
||||||
}
|
}
|
||||||
return &Device{
|
return &Device{
|
||||||
pins: [4]drivers.PinOutput{config.Pin1.Set, config.Pin2.Set, config.Pin3.Set, config.Pin4.Set},
|
pins: [4]pin.OutputFunc{config.Pin1.Set, config.Pin2.Set, config.Pin3.Set, config.Pin4.Set},
|
||||||
stepDelay: time.Second * 60 / time.Duration((config.StepCount * config.RPM)),
|
stepDelay: time.Second * 60 / time.Duration((config.StepCount * config.RPM)),
|
||||||
stepMode: config.Mode,
|
stepMode: config.Mode,
|
||||||
config: func() {
|
config: func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user