From d8612c11c486dbcbf9fbd6451744efea08c1fd50 Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Tue, 12 Dec 2017 23:23:10 +0100 Subject: [PATCH] fixed weird 255 max --- pca9685.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pca9685.go b/pca9685.go index 03d8f21..fe7a6c2 100644 --- a/pca9685.go +++ b/pca9685.go @@ -169,8 +169,8 @@ func (p *PCA9685) setPwmFreq(freqHz float32) { } func (p *PCA9685) setAllPwm(on int, off int) { - onB := byte(on) & BYTE - offB := byte(off) & BYTE + onB := byte(on) + offB := byte(off) p.i2cBus.WriteReg(ALL_LED_ON_L, []byte{onB & BYTE}) p.i2cBus.WriteReg(ALL_LED_ON_H, []byte{onB & BYTE}) @@ -179,8 +179,8 @@ func (p *PCA9685) setAllPwm(on int, off int) { } func (p *PCA9685) setPwm(pwm int, on int, off int) { - onB := byte(on) & BYTE - offB := byte(off) & BYTE + onB := byte(on) + offB := byte(off) p.i2cBus.WriteReg(LED0_ON_L+byte(4)*byte(pwm), []byte{onB & BYTE}) p.i2cBus.WriteReg(LED0_ON_H+byte(4)*byte(pwm), []byte{onB >> 8})