adafruit / Adafruit_CircuitPython_PCA9685

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

PCA9685 configured to take i2c commands from all addresses. #31

Closed ScottMonaghan closed 3 years ago

ScottMonaghan commented 4 years ago

I'm combining my PCA9685 with HT16K33 8x8 matrix. As soon as I send a command to the HT1633 the PCA stops responding and all my connected servos go limp.

The solution for this issue was identified here: https://github.com/rwaldron/johnny-five/issues/1591#issuecomment-524658577

It appears the issue was fixed in the arduino library but not corrected in circuit python (see https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library/commit/9f8e1dd41fc8d59a6776142274613b0d97da37a7#diff-5d1e3a5213c0ef6dedb2baf5cc323727L106-R110)

I confirmed the fix below works for me: Change line 163 of adafruit_pca9685 in frequency(self, freq) from self.mode1_reg = old_mode | 0xa1 # Mode 1, autoincrement on to self.mode1_reg = old_mode | 0xa0 # Mode 1, autoincrement on, fix to stop pca9685 from accepting commands at all addresses

I will submit a pull request with this change.

ScottMonaghan commented 4 years ago

Pull request here: https://github.com/adafruit/Adafruit_CircuitPython_PCA9685/pull/32