From 58f4af28b6f6b8b03873428d5e3245a9d82ffba7 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Fri, 7 Dec 2018 12:25:36 -0500 Subject: [PATCH] Add feature to set I2C address. --- adafruit_motorkit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_motorkit.py b/adafruit_motorkit.py index 157a034..5629e91 100644 --- a/adafruit_motorkit.py +++ b/adafruit_motorkit.py @@ -65,7 +65,7 @@ class MotorKit: """Class representing an Adafruit DC & Stepper Motor FeatherWing, Shield or Pi Hat kit. Automatically uses the I2C bus on a Feather, Metro or Raspberry Pi.""" - def __init__(self): + def __init__(self, address=0x60): self._motor1 = None self._motor2 = None self._motor3 = None @@ -73,7 +73,7 @@ def __init__(self): self._stepper1 = None self._stepper2 = None i2c = busio.I2C(board.SCL, board.SDA) - self._pca = PCA9685(i2c, address=0x60) + self._pca = PCA9685(i2c, address=address) self._pca.frequency = 1600 # We can save memory usage (~300 bytes) by deduplicating the construction of the objects for