Documentation ¶
Overview ¶
Package l9110x provides a driver to the L9110/L9110S H-bridge chip typically used to control DC motors.
Datasheet: https://www.elecrow.com/download/datasheet-l9110.pdf
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 is a motor without speed control. ia and ib are the directional pins.
type PWM ¶
type PWM interface { Configure(config machine.PWMConfig) error Channel(pin machine.Pin) (channel uint8, err error) Top() uint32 Set(channel uint8, value uint32) SetPeriod(period uint64) error }
PWM is the interface necessary for controlling the motor driver.
type PWMDevice ¶
type PWMDevice struct {
// contains filtered or unexported fields
}
PWMDevice is a motor with speed control. ia and ib are the directional/speed PWM pins.
func NewWithSpeed ¶
NewWithSpeed returns a new PWMMotor driver that uses 2 PWM pins to control both direction and speed.
func (*PWMDevice) Backward ¶
Backward turns motor on in backward direction at specific speed as a percentage.
func (*PWMDevice) Configure ¶
Configure configures the PWMDevice. Note that the pins, PWM interface, and channels must all already be configured.