Skip to content

Commit 35a9fc6

Browse files
authored
Merge pull request #7 from kattni/i2c-address
Add feature to set I2C address.
2 parents 06d2ad0 + 58f4af2 commit 35a9fc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_motorkit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ class MotorKit:
6565
"""Class representing an Adafruit DC & Stepper Motor FeatherWing, Shield or Pi Hat kit.
6666
6767
Automatically uses the I2C bus on a Feather, Metro or Raspberry Pi."""
68-
def __init__(self):
68+
def __init__(self, address=0x60):
6969
self._motor1 = None
7070
self._motor2 = None
7171
self._motor3 = None
7272
self._motor4 = None
7373
self._stepper1 = None
7474
self._stepper2 = None
7575
i2c = busio.I2C(board.SCL, board.SDA)
76-
self._pca = PCA9685(i2c, address=0x60)
76+
self._pca = PCA9685(i2c, address=address)
7777
self._pca.frequency = 1600
7878

7979
# We can save memory usage (~300 bytes) by deduplicating the construction of the objects for

0 commit comments

Comments
 (0)