Skip to content

Commit c347623

Browse files
committed
Fixed issue 31 PCA9685 configured to take i2c commands from all addresses
Issue description: 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: rwaldron/johnny-five#1591 (comment) It appears the issue was fixed in the arduino library but not corrected in circuit python (see adafruit/Adafruit-PWM-Servo-Driver-Library@9f8e1dd#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.
1 parent d094689 commit c347623

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_pca9685.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def frequency(self, freq):
160160
self.prescale_reg = prescale # Prescale
161161
self.mode1_reg = old_mode # Mode 1
162162
time.sleep(0.005)
163-
self.mode1_reg = old_mode | 0xA1 # Mode 1, autoincrement on
163+
self.mode1_reg = old_mode | 0xa0 # Mode 1, autoincrement on, fix to stop pca9685 from accepting commands at all addresses
164164

165165
def __enter__(self):
166166
return self
@@ -170,4 +170,4 @@ def __exit__(self, exception_type, exception_value, traceback):
170170

171171
def deinit(self):
172172
"""Stop using the pca9685."""
173-
self.reset()
173+
self.reset()

0 commit comments

Comments
 (0)