Documentation ¶
Overview ¶
Package easystepper provides a simple driver to rotate a 4-wire stepper motor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device holds the pins and the delay between steps
func New ¶
func New(config DeviceConfig) (*Device, error)
New returns a new single easystepper driver given a DeviceConfig
func (*Device) Configure ¶ added in v0.9.0
func (d *Device) Configure()
Configure configures the pins of the Device
type DeviceConfig ¶ added in v0.21.0
type DeviceConfig struct {
// Pin1 ... Pin4 determines the pins to configure and use for the device
Pin1, Pin2, Pin3, Pin4 machine.Pin
// StepCount is the number of steps required to perform a full revolution of the stepper motor
StepCount uint
// RPM determines the speed of the stepper motor in 'Revolutions per Minute'
RPM uint
// Mode determines the coil sequence used to perform a single step
Mode StepMode
}
DeviceConfig contains the configuration data for a single easystepper driver
type DualDevice ¶ added in v0.9.0
type DualDevice struct {
// contains filtered or unexported fields
}
DualDevice holds information for controlling 2 motors
func NewDual ¶ added in v0.9.0
func NewDual(config DualDeviceConfig) (*DualDevice, error)
NewDual returns a new dual easystepper driver given 8 pins, number of steps and rpm
func (*DualDevice) Configure ¶ added in v0.9.0
func (d *DualDevice) Configure()
Configure configures the pins of the DualDevice
func (*DualDevice) Move ¶ added in v0.9.0
func (d *DualDevice) Move(stepsA, stepsB int32)
Move rotates the motors the number of given steps (negative steps will rotate it the opposite direction)
type DualDeviceConfig ¶ added in v0.21.0
type DualDeviceConfig struct { DeviceConfig // Pin5 ... Pin8 determines the pins to configure and use for the second device Pin5, Pin6, Pin7, Pin8 machine.Pin }
DualDeviceConfig contains the configuration data for a dual easystepper driver