Skip to content

Commit 21dec61

Browse files
committed
correct DRIVE order for steppers; improve stepper names
1 parent f948e09 commit 21dec61

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

adafruit_crickit.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,17 @@
6868

6969
_MOTOR1 = (22, 23)
7070
_MOTOR2 = (19, 18)
71-
_MOTOR_ALL = _MOTOR1 + _MOTOR2
71+
# Order as needed for steppers.
72+
_MOTOR_STEPPER = _MOTOR1 + _MOTOR2
7273

7374
_DRIVE1 = const(13)
7475
_DRIVE2 = const(12)
7576
_DRIVE3 = const(43)
7677
_DRIVE4 = const(42)
7778

78-
_DRIVE_ALL = (_DRIVE1, _DRIVE2, _DRIVE3, _DRIVE4)
79+
# Order as needed for steppers.
80+
_DRIVE_STEPPER = (_DRIVE1, _DRIVE3, _DRIVE2, _DRIVE4)
81+
7982

8083
_TOUCH1 = const(4)
8184
_TOUCH2 = const(5)
@@ -232,17 +235,17 @@ def dc_motor_2(self):
232235
@property
233236
def stepper_motor(self):
234237
"""``adafruit_motor.motor.StepperMotor`` object on Motor 1 and Motor 2 terminals"""
235-
return self._motor(_MOTOR_ALL, StepperMotor)
238+
return self._motor(_MOTOR_STEPPER, StepperMotor)
236239

237240
@property
238241
def drive_stepper_motor(self):
239242
"""``adafruit_motor.motor.StepperMotor`` object on Drive terminals"""
240-
return self._motor(_DRIVE_ALL, StepperMotor)
243+
return self._motor(_DRIVE_STEPPER, StepperMotor)
241244

242245
@property
243246
def feather_drive_stepper_motor(self):
244247
"""``adafruit_motor.motor.StepperMotor`` object on Drive terminals on Crickit FeatherWing"""
245-
return self._motor(reversed(_DRIVE_ALL), StepperMotor)
248+
return self._motor(reversed(_DRIVE_STEPPER), StepperMotor)
246249

247250
def _motor(self, terminals, motor_class):
248251
device = self._devices.get(terminals, None)

0 commit comments

Comments
 (0)