Documentation ¶
Overview ¶
Package pca9685 is a driver for the PCA9685 I2C servo/pwm board. e.g. https://www.adafruit.com/product/815
Index ¶
Constants ¶
View Source
const ( REG_MODE1 byte = iota REG_MODE2 REG_SUBADR1 REG_SUBADR2 REG_SUBADR3 REG_ALLCALLADR REG_PWM0_ON_L REG_PWM0_ON_H REG_PWM0_OFF_L REG_PWM0_OFF_H REG_PRESCALE = 0xFE )
Register names and addresses.
View Source
const ( MODE1_ALLCAL byte = 1 << iota MODE1_SUB3 MODE1_SUB2 MODE1_SUB1 MODE1_SLEEP MODE1_AI MODE1_EXTCLK MODE1_RESTART )
MODE1 bit values.
View Source
const ( CLOCK_MHZ = 25 PRESCALE_SERVO = 121 // 50Hz MICROS_PER_TICK = (PRESCALE_SERVO + 1 + CLOCK_MHZ/2) / CLOCK_MHZ )
Typical PWM prescalar values (assuming a 25MHz clock).
View Source
const Address = 0x40
The I2C address which this device listens to by default.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device wraps an I2C connection to the device.
func New ¶
New creates a new PCA9685 connection. The I2C bus must already be configured.
This function only creates the Device object. It does not touch the device.
Click to show internal directories.
Click to hide internal directories.