1
0
Fork 0
mirror of https://github.com/kidoman/embd synced 2025-07-03 03:47:33 +02:00

- support for servo blaster

- servo requires the underlying PWM to support a SetMicroseconds method
This commit is contained in:
Karan Misra 2014-01-09 02:35:18 +05:30
parent cce1943e34
commit 7c32e907e1
7 changed files with 124 additions and 19 deletions

View file

@ -149,6 +149,11 @@ func (d *PCA9685) SetPwm(channel, onTime, offTime int) (err error) {
return
}
func (d *PCA9685) SetMicroseconds(channel, us int) (err error) {
offTime := us * d.Freq * pwmControlPoints / 1000000
return d.SetPwm(channel, 0, offTime)
}
// Close stops the controller and resets mode and pwm controller registers.
func (d *PCA9685) Close() (err error) {
if err = d.setup(); err != nil {