From a099481b3e81eba8e960a60d7d2786bdcde2bf23 Mon Sep 17 00:00:00 2001 From: Musab Erdem Date: Thu, 18 Jul 2024 11:51:09 +0200 Subject: [PATCH] LSP Kommunikation optimiert --- main.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index d2ddb2d..a7a26cc 100644 --- a/main.py +++ b/main.py @@ -451,7 +451,16 @@ class ArduinoGUI: self.ser.write(message.encode()) while self.ser.out_waiting: pass - self.ser.read_all() + if command == 'w': + self.tare_angle() + if command == 'u': + time.sleep(5) + string = self.ser.read_until(b"u") + outCommand = F"u{string}u\n" + self.arduino.write(outCommand.encode()) + time.sleep(0.1) + + self.ser.read_all() except Exception as e: print(e) #self.ser.write(b'Hallo\n')