added support for color correction

This commit is contained in:
2019-05-05 21:30:02 +02:00
parent 75d3c41a5c
commit eb2a0e7a98
3 changed files with 5 additions and 5 deletions

View File

@@ -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