← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.py b/main.py
index 47105d7..eb2b797 100755
--- a/main.py
+++ b/main.py
@@ -31,25 +31,25 @@ def calcCurDir(x, y, xo, yo):
def adjustAngle(adiff, f, b):
if f == True:
print("Going forward")
- if adiff < -10:
+ if adiff < 0:
print("Adjusting to the right")
NANO.write(b"Right\n")
sleep(abs(adiff) / 90)
NANO.write(b"Stop\n")
- elif adiff > 10:
+ elif adiff > 0:
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:
+ if adiff > 0:
adiff -= 180
print(f"Adjusting to the right {adiff}")
NANO.write(b"Right\n")
sleep(abs(adiff) / 90)
NANO.write(b"Stop\n")
- elif adiff < -10:
+ elif adiff < 0:
adiff += 180
print(f"Adjusting to the left {adiff}")
NANO.write(b"Left\n")