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:
parent
cce1943e34
commit
7c32e907e1
7 changed files with 124 additions and 19 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue