← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdvin <[email protected]>2025-05-07 13:45:58 +0200
committerEdvin <[email protected]>2025-05-07 13:45:58 +0200
commit51fddf98a043bb9b32518f19030da2127bf914fe (patch)
treedc041b9151e3d0e99144507f96d62028fc6b535e
parent9e5aabc05c41365bffeedc20fe50be26cb02bbbb (diff)
LIDAR detection behind
-rwxr-xr-xmain.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/main.py b/main.py
index 0fe2dc8..722518e 100755
--- a/main.py
+++ b/main.py
@@ -206,13 +206,16 @@ if bto.find("Connected") != -1:
a = int(a)
d = int(d)
- if (a < 20 or a > 340) and d < 300:
+ if (a < 25 or a > 335) and d < 300:
forward = False
if backward == False:
NANO.write(b"Stop\n")
- if (a > 160 and a < 200):
- print(f"{a}, {d}")
+ if (a > 155 and a < 170) or (a > 190 and a < 205):
+ print("Something behind!")
+ backward = False
+ if forward == False:
+ NANO.write(b"Stop\n")
if forward:
NANO.write(b"Forward\n")