Documentation ¶
Overview ¶
Package pca9685 includes utilities to controls pca9685 module and servo motors.
More details ¶
Datasheet ¶
https://www.nxp.com/docs/en/data-sheet/PCA9685.pdf
Product page:
Index ¶
Examples ¶
Constants ¶
const I2CAddr uint16 = 0x40
I2CAddr i2c default address.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dev ¶
type Dev struct {
// contains filtered or unexported fields
}
Dev is a handler to pca9685 controller
func NewI2C ¶
NewI2C returns a Dev object that communicates over I2C.
To use on the default address, pca9685.I2CAddr must be passed as argument.
type Servo ¶
type Servo struct {
// contains filtered or unexported fields
}
Servo individual servo from a group of servos connected to a pca9685 module
func (*Servo) SetMinMaxAngle ¶
SetMinMaxAngle change angle limits for the servo
type ServoGroup ¶
type ServoGroup struct { *Dev // contains filtered or unexported fields }
ServoGroup a group of servos connected to a pca9685 module
func NewServoGroup ¶
NewServoGroup returns a servo group connected throught the pca9685 module some pwm and angle limits can be set
func (*ServoGroup) GetServo ¶
func (s *ServoGroup) GetServo(channel int) *Servo
GetServo returns a individual Servo to be controlled
func (*ServoGroup) SetAngle ¶
func (s *ServoGroup) SetAngle(channel int, angle physic.Angle) error
SetAngle set an angle in a given channel of the servo group
func (*ServoGroup) SetMinMaxPwm ¶
func (s *ServoGroup) SetMinMaxPwm(minAngle, maxAngle physic.Angle, minPwm, maxPwm gpio.Duty)
SetMinMaxPwm change pwm and angle limits