From 88fe004e1347e6e299b3b8632c65d7fe30c03ebe Mon Sep 17 00:00:00 2001 From: Edvin Date: Mon, 12 May 2025 13:54:18 +0200 Subject: Fixed issue with adjustments not ending --- arduino/arduino.ino | 2 +- main.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/arduino/arduino.ino b/arduino/arduino.ino index 5ab3c43..c4c6c99 100644 --- a/arduino/arduino.ino +++ b/arduino/arduino.ino @@ -163,7 +163,7 @@ void loop() { } lcd.setCursor(13, 0); lcd.print(dir); - lcd.setCursor(0, 1); + lcd.setCursor(1, 1); lcd.print("x:"); lcd.print(xstatus); lcd.print(", y:"); diff --git a/main.py b/main.py index ae57298..47105d7 100755 --- a/main.py +++ b/main.py @@ -35,22 +35,26 @@ def adjustAngle(adiff, f, b): print("Adjusting to the right") NANO.write(b"Right\n") sleep(abs(adiff) / 90) + NANO.write(b"Stop\n") elif adiff > 10: print("Adjusting to the left") NANO.write(b"Left\n") sleep(abs(adiff) / 90) + NANO.write(b"Stop\n") elif b == True: print("Going backward") if adiff > 10: adiff -= 180 print(f"Adjusting to the right {adiff}") - # NANO.write(b"Right\n") - # sleep(abs(adiff) / 90) + NANO.write(b"Right\n") + sleep(abs(adiff) / 90) + NANO.write(b"Stop\n") elif adiff < -10: adiff += 180 print(f"Adjusting to the left {adiff}") - # NANO.write(b"Left\n") - # sleep(abs(adiff) / 90) + NANO.write(b"Left\n") + sleep(abs(adiff) / 90) + NANO.write(b"Stop\n") def writeAngleToFile(a): with open("angle_buf.txt", "w") as f: -- cgit v1.2.3