Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Address default for controller Address byte = 0x40 // Registers Mode1 byte = 0x00 Prescale byte = 0xFE Led0On byte = 0x06 // The internal reference clock is 25mhz but may vary slightly with // environmental conditions and manufacturing variances. Providing a more precise // "ReferenceClockSpeed" can improve the accuracy of the frequency and duty_cycle computations. ReferenceClockSpeed float32 = 25000000.0 // 25MHz StepCount float32 = 4096.0 // 12-bit DefaultPWMFrequency float32 = 50.0 // 50Hz )
View Source
const ( // The specified pulse width range of a servo has historically been 1000-2000us, // for a 90 degree range of motion. But nearly all modern servos have a 170-180 // degree range, and the pulse widths can go well out of the range to achieve this // extended motion. The default values here of `750` and `2250` typically give // 135 degrees of motion. You can set `Range` to correspond to the // actual range of motion you observe with your given `MinPulse` and `MaxPulse` values. ServoRangeDef int = 135 ServoMinPulseDef float32 = 750.0 ServoMaxPulseDef float32 = 2250.0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PCA9685 ¶
type PCA9685 struct {
// contains filtered or unexported fields
}
PCA9685 is a Driver for the PCA9685 16-channel 12-bit PWM/Servo controller
func New ¶ added in v0.1.3
New creates the new PCA9685 driver with specified i2c interface and options
func (*PCA9685) ServoNew ¶ added in v0.1.3
func (pca *PCA9685) ServoNew(chn int, o *ServOptions) *Servo
ServoNew creates a new servo driver
func (*PCA9685) SetChannel ¶
SetChannel sets a single PWM channel
type ServOptions ¶ added in v0.1.0
ServOptions for servo
type Servo ¶ added in v0.1.0
type Servo struct {
// contains filtered or unexported fields
}
Servo structure
Click to show internal directories.
Click to hide internal directories.
