From 20b837dab99f9385b04b8c5b581001c8c0b9ea12 Mon Sep 17 00:00:00 2001 From: Edvin Date: Fri, 4 Apr 2025 09:07:18 +0200 Subject: Added behaviour for command '11' --- main.py | 9 ++++++--- 1 file 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) -- cgit v1.2.3