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

Make duty_cycle return the same value it was set to... #53

Closed DrRob closed 1 year ago

DrRob commented 1 year ago

...albeit with the least significant four bits set to zero (the device only uses the most significant twelve bits and doesn't store the remaining four, so these will be lost).

Also set the special bit for "fully off" instead of setting the LEDn_ON and LEDn_OFF registers to the same value, as instructed in the datasheet.

dhalbert commented 1 year ago

Could someone test the "fully off" fix on a PCA9685 board?

DrRob commented 1 year ago

Could someone test the "fully off" fix on a PCA9685 board?

BTW, setting the duty_cycle value to zero was already turning the output fully off, but doing so in a way contrary to the guidance in the datasheet, which is why I changed that part as well.

I've tested with an oscilloscope on one of the PCA9685 outputs and it does turn the output fully off. (It would make sense for someone else to verify that, of course.)