Skip to content

Commit e3eb23c

Browse files
committed
Changed the default value of motor_stop() API
1 parent 3af3492 commit e3eb23c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

neopia/neosoco.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def motor_move(self, direction='forward'):
584584
raise TypeError
585585
Runner.wait(100) # Since broadcast from controller is per 100ms
586586

587-
def motor_stop(self, which_motor: str):
587+
def motor_stop(self, which_motor='both'):
588588
if isinstance(which_motor, str):
589589
if which_motor.lower() =='right':
590590
self.write(Neosoco.RIGHT_MOTOR, 0)
@@ -594,10 +594,8 @@ def motor_stop(self, which_motor: str):
594594
self.write(Neosoco.LEFT_MOTOR, 0)
595595
self.write(Neosoco.RIGHT_MOTOR, 0)
596596
else:
597-
Runner.shutdown() # The motor will not stop unless the shutdown() function is used
598597
raise ValueError('Wrong value of motor')
599598
else:
600-
Runner.shutdown() # The motor will not stop unless the shutdown() function is used
601599
raise TypeError
602600
Runner.wait(100) # Since broadcast from controller is per 100ms
603601

0 commit comments

Comments
 (0)