fixed wrong conversion to percentage

This commit is contained in:
2019-05-03 20:50:41 +02:00
parent 5c2fe2f073
commit 83cd06a2f5

View File

@@ -96,14 +96,13 @@ func (daemon *LedDaemon) receive() {
continue
}
vPerc := float64(v) / float64(RESOLUTION)
//vPerc = math.Pow(vPerc, 1/readConfig.Pca9685.Gamma)
if pwm, ok := pwmMap[c]; ok {
pwm.setPercentage(float32(vPerc * 100))
pwm.setPercentage(float32(v * 100))
} else {
pwmMap[c] = pca9685.NewPwm(int(c))
pwmMap[c].setPercentage(float32(vPerc * 100))
pwmMap[c].setPercentage(float32(v * 100))
}
}
}