← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdvin <[email protected]>2025-05-07 15:30:37 +0200
committerEdvin <[email protected]>2025-05-07 15:30:37 +0200
commitd6cd2a29677f848ff8ef8d5d67bbc48698e04d69 (patch)
tree48ff3cfffd6e2125ebd18feb549a9f37efe8e82f
parent8c4b1af34280bc4844ba864fd508f198a3979397 (diff)
Added stop for forward/backward movement
-rwxr-xr-xmain.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.py b/main.py
index cd52dfd..b39a2bf 100755
--- a/main.py
+++ b/main.py
@@ -206,12 +206,12 @@ if bto.find("Connected") != -1:
a = int(a)
d = int(d)
- if (a < 25 or a > 335) and d < 300:
+ if (a < 25 or a > 335) and (d > 0 and d < 300):
forward = False
if backward == False:
NANO.write(b"Stop\n")
- if ((a > 155 and a < 170) or (a > 190 and a < 205)) and d < 300:
+ if ((a > 155 and a < 170) or (a > 190 and a < 205)) and (d > 0 and d < 300):
print("Something behind!")
backward = False
if forward == False: