adafruit / Adafruit_CircuitPython_PCA9685

Adafruit CircuitPython driver for PCA9685 16-channel, 12-bit PWM LED & servo driver chip.
MIT License
120 stars 64 forks source link

Suggesting an error message solution #47

Closed tcfranks closed 1 year ago

tcfranks commented 1 year ago

resolves #29 submitted for review / comment.

My 2 cents. it appears the only way the prescale_reg value can go south (it's read when invoked, I think) would be for I2C to fail. According the the specsheet for PCA9685 chip, the register should be in the range of 0x03 <= value <= 0xFF. I've only suggested for the low end, but to be airtight do we want to go the full way? (spec sheet p 25 of 52)

tcfranks commented 1 year ago

also, the frequency setter already checks against trying to prescale a value < 3, but does not check the prescale result of > 255.

tcfranks commented 1 year ago

@tekktrik in florida for 10 days with only a phone. Will tend to this when I get home!

tcfranks commented 1 year ago

submitted for review of suggested mod