fixed max pulse check
This commit is contained in:
@@ -189,7 +189,7 @@ func (p *PCA9685) setPwm(pwm int, on uint16, off uint16) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (pwm *Pwm) setPercentage(percentage float32) error {
|
func (pwm *Pwm) setPercentage(percentage float32) error {
|
||||||
if percentage < 0.0 || percentage > 100.0 || pwm.pca.maxPulse > 65536 {
|
if percentage < 0.0 || percentage > 100.0 {
|
||||||
|
|
||||||
return errors.New(fmt.Sprintf("Percentage must be between 0.0 and 100.0. Got %v.", percentage))
|
return errors.New(fmt.Sprintf("Percentage must be between 0.0 and 100.0. Got %v.", percentage))
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user