File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 51
51
52
52
"""
53
53
54
- # imports
55
-
56
- __version__ = "0.0.0-auto.0"
57
- __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MotorKit.git"
58
54
59
55
import board
60
- import busio
61
56
from adafruit_pca9685 import PCA9685
62
57
58
+ __version__ = "0.0.0-auto.0"
59
+ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MotorKit.git"
60
+
63
61
64
62
class MotorKit :
65
63
"""Class representing an Adafruit DC & Stepper Motor FeatherWing, Shield or Pi Hat kit.
66
64
67
65
Automatically uses the I2C bus on a Feather, Metro or Raspberry Pi."""
68
- def __init__ (self , address = 0x60 ):
66
+ def __init__ (self , address = 0x60 , i2c = None ):
69
67
self ._motor1 = None
70
68
self ._motor2 = None
71
69
self ._motor3 = None
72
70
self ._motor4 = None
73
71
self ._stepper1 = None
74
72
self ._stepper2 = None
75
- i2c = busio .I2C (board .SCL , board .SDA )
73
+ if i2c is None :
74
+ i2c = board .I2C ()
76
75
self ._pca = PCA9685 (i2c , address = address )
77
76
self ._pca .frequency = 1600
78
77
You can’t perform that action at this time.
0 commit comments