Skip to content

Commit 901e58e

Browse files
committed
fix elapse negative
1 parent 2bec525 commit 901e58e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rotary_encoder/wheelsaxel.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ def control_time(self, power_left=100, power_right=100, time_elapse=0):
8686
self._is_moving = True
8787

8888
# moving for desired time
89-
sleep(max(time_elapse, 0))
90-
self.stop()
89+
if time_elapse > 0:
90+
sleep(max(time_elapse, 0))
91+
self.stop()
9192

9293
""" Motor distance control allows the motors
9394
to run for a certain amount of distance (mm) """

0 commit comments

Comments
 (0)