Skip to content

Fixed issue 31 PCA9685 configured to take i2c commands from all addre… #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion adafruit_pca9685.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def frequency(self, freq):
self.prescale_reg = prescale # Prescale
self.mode1_reg = old_mode # Mode 1
time.sleep(0.005)
self.mode1_reg = old_mode | 0xA1 # Mode 1, autoincrement on
# Mode 1, autoincrement on, fix to stop pca9685 from accepting commands at all addresses
self.mode1_reg = old_mode | 0xA0

def __enter__(self):
return self
Expand Down
6 changes: 3 additions & 3 deletions examples/pca9685_servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from board import SCL, SDA
import busio

# Import the PCA9685 module.
from adafruit_pca9685 import PCA9685

# This example also relies on the Adafruit motor library available here:
# https://github.com/adafruit/Adafruit_CircuitPython_Motor
from adafruit_motor import servo

# Import the PCA9685 module.
from adafruit_pca9685 import PCA9685

i2c = busio.I2C(SCL, SDA)

# Create a simple PCA9685 class instance.
Expand Down