diff --git a/adafruit_motorkit.py b/adafruit_motorkit.py index 3f7b784..9c1511b 100644 --- a/adafruit_motorkit.py +++ b/adafruit_motorkit.py @@ -62,7 +62,10 @@ 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.""" + Automatically uses the I2C bus on a Feather, Metro or Raspberry Pi if no I2C bus + is supplied. + + Alternately, if using with multiple I2C devices, you can specify the I2C bus.""" def __init__(self, address=0x60, i2c=None, steppers_microsteps=16): self._motor1 = None diff --git a/examples/motorkit_dc_motor_simpletest.py b/examples/motorkit_dc_motor_simpletest.py index 770c490..0ae0fe7 100644 --- a/examples/motorkit_dc_motor_simpletest.py +++ b/examples/motorkit_dc_motor_simpletest.py @@ -1,8 +1,9 @@ """Simple test for using adafruit_motorkit with a DC motor""" import time +import board from adafruit_motorkit import MotorKit -kit = MotorKit() +kit = MotorKit(i2c=board.I2C()) kit.motor1.throttle = 1.0 time.sleep(0.5) diff --git a/examples/motorkit_dc_test.py b/examples/motorkit_dc_test.py index d3b4f28..0445306 100755 --- a/examples/motorkit_dc_test.py +++ b/examples/motorkit_dc_test.py @@ -1,7 +1,8 @@ import time +import board from adafruit_motorkit import MotorKit -kit = MotorKit() +kit = MotorKit(i2c=board.I2C()) kit.motor1.throttle = 0 diff --git a/examples/motorkit_dual_stepper_test.py b/examples/motorkit_dual_stepper_test.py index 2faf71b..0931f77 100644 --- a/examples/motorkit_dual_stepper_test.py +++ b/examples/motorkit_dual_stepper_test.py @@ -6,11 +6,12 @@ import atexit import threading import random +import board from adafruit_motor import stepper as STEPPER from adafruit_motorkit import MotorKit # create a default object, no changes to I2C address or frequency -kit = MotorKit() +kit = MotorKit(i2c=board.I2C()) # create empty threads (these will hold the stepper 1 and 2 threads) st1 = threading.Thread() # pylint: disable=bad-thread-instantiation diff --git a/examples/motorkit_robot.py b/examples/motorkit_robot.py index 7bed7d1..98cf5ad 100644 --- a/examples/motorkit_robot.py +++ b/examples/motorkit_robot.py @@ -14,9 +14,10 @@ import time import atexit +import board from adafruit_motorkit import MotorKit -kit = MotorKit() +kit = MotorKit(i2c=board.I2C()) class Robot: diff --git a/examples/motorkit_stepper_simpletest.py b/examples/motorkit_stepper_simpletest.py index 78f7b4e..8725e61 100644 --- a/examples/motorkit_stepper_simpletest.py +++ b/examples/motorkit_stepper_simpletest.py @@ -1,8 +1,9 @@ """Simple test for using adafruit_motorkit with a stepper motor""" import time +import board from adafruit_motorkit import MotorKit -kit = MotorKit() +kit = MotorKit(i2c=board.I2C()) for i in range(100): kit.stepper1.onestep() diff --git a/examples/motorkit_stepper_test.py b/examples/motorkit_stepper_test.py index 32f8983..6f5f6a7 100755 --- a/examples/motorkit_stepper_test.py +++ b/examples/motorkit_stepper_test.py @@ -1,7 +1,8 @@ +import board from adafruit_motor import stepper from adafruit_motorkit import MotorKit -kit = MotorKit() +kit = MotorKit(i2c=board.I2C()) kit.stepper1.release()