← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorEdvin <[email protected]>2025-05-08 11:40:26 +0200
committerEdvin <[email protected]>2025-05-08 11:40:26 +0200
commitc632c1cc164c67cbafa73366cf9a3409666fbb6c (patch)
tree2427e3798d9b81b8fc65e6e21180b2b15161f75c /main.py
parent0d2ac90175637576567668ecd9e8212341b3d26d (diff)
Added goal communication
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/main.py b/main.py
index d1a05a7..06b27cd 100755
--- a/main.py
+++ b/main.py
@@ -164,8 +164,13 @@ if bto.find("Connected") != -1:
sleep(0.45)
NANO.write(b"Stop\n")
elif bto == "420":
- print("reset")
- desDir = 0
+ NANO.write(b"Goal\n")
+ print(NANO.readline())
+ GPIO.output(LED, True)
+ goal_read = False
+ while goal_read == False:
+ goal_read = GPIO.input(PT)
+ GPIO.output(LED, False)
elif bto == "0":
NANO.write(b"Stop\n")
forward = False