diff options
| author | Edvin <[email protected]> | 2025-04-04 09:07:18 +0200 |
|---|---|---|
| committer | Edvin <[email protected]> | 2025-04-04 09:07:18 +0200 |
| commit | 20b837dab99f9385b04b8c5b581001c8c0b9ea12 (patch) | |
| tree | 6948f7308d9fb920bf4cf080a627420e382ee95e | |
| parent | ab12fc60ed76a8db240e11c6cb19344f906c1928 (diff) | |
Added behaviour for command '11'
| -rw-r--r-- | main.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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) |
