From 4ecbb9ef9054855b91f672c82282c47f36948a22 Mon Sep 17 00:00:00 2001 From: George_Andreou Date: Sun, 22 Jun 2025 00:06:30 +0300 Subject: [PATCH] Changed the throttle and fixed the left motors spin --- rally.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/rally.py b/rally.py index d6a8737..543e796 100644 --- a/rally.py +++ b/rally.py @@ -58,12 +58,12 @@ while sonar.distance < 20: break print(">>>>> Starting movement!!!") -mot_right.throttle = 0.5 -mot_left.throttle = 0.5 +mot_right.throttle = 1 +mot_left.throttle = - 1 while True: # Find the motor revolutions - revleft = enc_left.position / COUNTS_PER_REV + revleft = - enc_left.position / COUNTS_PER_REV revright = enc_right.position / COUNTS_PER_REV distleft = revleft * circumference @@ -77,4 +77,9 @@ while True: print("Target reached!!!") mot_left.throttle = 0 mot_right.throttle = 0 - break \ No newline at end of file + break + + mot_right.throttle = 1 + mot_left.throttle = - 1 + + time.sleep(0.05)