Documentation ¶
Overview ¶
Package l293x provides a driver to the L293/L293D H-bridge chip typically used to control DC motors.
Datasheet: https://www.ti.com/lit/ds/symlink/l293d.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. a1 and a2 are the directional pins. en is the pin turns the motor on/off.
type PWM ¶ added in v0.16.0
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. a1 and a2 are the directional GPIO pins. en is the PWM pin that controls the motor speed.
func NewWithSpeed ¶
NewWithSpeed returns a new PWMMotor driver that uses an already configured PWM channel to control 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 PWM interface and channel must already be configured, this function will not do it for you.