Skip to content

Commit 04d9ada

Browse files
committed
fix(BYJMotor): Behavior when running the motor after a stop
1 parent 280ed7e commit 04d9ada

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

RpiMotorLib/RpiMotorLib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def motor_run(self, gpiopins, wait=.001, steps=512, ccwise=False,
8181
8282
"""
8383
try:
84+
self.stop_motor = False
8485
for pin in gpiopins:
8586
GPIO.setup(pin, GPIO.OUT)
8687
GPIO.output(pin, False)
@@ -147,8 +148,7 @@ def print_status(enabled_pins):
147148
while steps_remaining > 0:
148149
for pin_list in step_sequence:
149150
for pin in gpiopins:
150-
if self.stop_motor:
151-
self.stop_motor = False
151+
if self.stop_motor == True:
152152
raise StopMotorInterrupt
153153
else:
154154
if pin in pin_list:

0 commit comments

Comments
 (0)