added support for color correction
This commit is contained in:
@@ -180,7 +180,7 @@ func (pwm *Pwm) setPercentage(percentage float32) error {
|
||||
return errors.New(fmt.Sprintf("Percentage must be between 0.0 and 100.0. Got %v.", percentage))
|
||||
}
|
||||
|
||||
pwm.pca.log.Info(fmt.Sprintf("Setting pwm #%v to %v%% at \"%v\" device.", pwm.pin, percentage, pwm.pca.name))
|
||||
pwm.pca.log.Info(fmt.Sprintf("Setting pwm #%v to %v%% (%v) at \"%v\" device.", pwm.pin, percentage, uint16((percentage/100)*float32(pwm.pca.maxPulse)), pwm.pca.name))
|
||||
pwm.pca.setPwm(pwm.pin, 0, uint16((percentage/100)*float32(pwm.pca.maxPulse)))
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user