Browse Source

control.py: strip any spaces off

Peter Cai 11 months ago
parent
commit
af14647675
Signed by: Peter Cai <[email protected]> GPG Key ID: 71F5FB4E4F3FD54F
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      control.py

+ 2
- 2
control.py View File

@@ -9,8 +9,8 @@ ser.baudrate = 115200
9 9
 ser.open()
10 10
 time.sleep(2)
11 11
 while True:
12
-  line = sys.stdin.readline().upper()
13
-  if line == "EXIT\n":
12
+  line = sys.stdin.readline().strip().upper()
13
+  if line == "EXIT":
14 14
     break
15 15
   arr = line.split(" ")
16 16
   bytesToWrite = arr[0].encode("ascii") + b" "

Loading…
Cancel
Save