← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorEdvin <[email protected]>2025-04-04 09:07:18 +0200
committerEdvin <[email protected]>2025-04-04 09:07:18 +0200
commit20b837dab99f9385b04b8c5b581001c8c0b9ea12 (patch)
tree6948f7308d9fb920bf4cf080a627420e382ee95e /main.py
parentab12fc60ed76a8db240e11c6cb19344f906c1928 (diff)
Added behaviour for command '11'
Diffstat (limited to 'main.py')
-rw-r--r--main.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/main.py b/main.py
index 8c0e777..053899c 100644
--- a/main.py
+++ b/main.py
@@ -39,8 +39,11 @@ while client_sock:
read = read.decode("utf-8").strip('\n')
print(read)
- if read == "0": # Do nothing
- if read == "11": # Drive forward
+ if read == "0": # Do nothing
+ GPIO.output(P1, False)
+ GPIO.output(P2, False)
+ GPIO.output(P3, False)
+ elif read == "11": # Drive forward
GPIO.output(P1, True)
GPIO.output(P2, False)
GPIO.output(P3, False)
@@ -68,7 +71,7 @@ while client_sock:
GPIO.output(P1, True)
GPIO.output(P2, True)
GPIO.output(P3, True)
- else: # Do nothing
+ else: # Do nothing if command is not recognized
GPIO.output(P1, False)
GPIO.output(P2, False)
GPIO.output(P3, False)