testing correct reg_16
This commit is contained in:
@@ -182,10 +182,10 @@ func (p *PCA9685) setPwm(pwm int, on uint16, off uint16) {
|
||||
onB := byte(on)
|
||||
offB := byte(off)
|
||||
|
||||
p.i2cBus.WriteReg(LED0_ON_L+byte(4)*byte(pwm), []byte{onB & WORD})
|
||||
p.i2cBus.WriteReg(LED0_ON_H+byte(4)*byte(pwm), []byte{onB >> 8})
|
||||
p.i2cBus.WriteReg(LED0_OFF_L+byte(4)*byte(pwm), []byte{offB & WORD})
|
||||
p.i2cBus.WriteReg(LED0_OFF_H+byte(4)*byte(pwm), []byte{offB >> 8})
|
||||
p.i2cBus.WriteReg(LED0_ON_L+byte(4)*byte(pwm), []byte{onB & 0xF0})
|
||||
p.i2cBus.WriteReg(LED0_ON_H+byte(4)*byte(pwm), []byte{onB & 0x0F})
|
||||
p.i2cBus.WriteReg(LED0_OFF_L+byte(4)*byte(pwm), []byte{offB & 0xF0})
|
||||
p.i2cBus.WriteReg(LED0_OFF_H+byte(4)*byte(pwm), []byte{offB & 0x0F})
|
||||
}
|
||||
|
||||
func (pwm *Pwm) setPercentage(percentage float32) error {
|
||||
|
Reference in New Issue
Block a user