package
Version:
v0.0.0-...-1be9672
Opens a new window with list of versions in this module.
Published: Jun 1, 2019
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Motor struct {
Offset bool
Speed int
}
Motor is a DC motor type.
func NewMotor(channel, directionChannel int) *Motor
NewMotor creates a new DC motor instance.
func (d *Motor) Backward()
Backward sets the motor direction backward.
Close cleans up any used resources.
func (d *Motor) Forward()
Forward sets the motor direction to forward.
Init the TB6612 DC motor driver controller.
SetOffset sets the offset.
SetPWM sets the duty cycle.
SetSpeed sets the motor speed.
Stop stops the motor by setting the speed to 0.
PCA9685 is a PCA9685 driver type.
NewPCA9685 creates a new instance of the PCA9685 driver.
Close cleans up all PCA9685 resources.
Init the PCA9685 16-channel 12-bit PWM/Servo controller.
Map the value from one range to another.
SetFreq sets the frequency.
Write writes data to a specific channel.
WriteAll sets the on/off values for all channels.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.