From 582bdec6c527d995c62718df284eaf554968c2d1 Mon Sep 17 00:00:00 2001 From: Musab Erdem Date: Mon, 22 Jul 2024 11:41:57 +0200 Subject: [PATCH] Optimierung der LSP Schnittstelle --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index d53002a..eb392f6 100644 --- a/main.py +++ b/main.py @@ -444,14 +444,14 @@ class ArduinoGUI: if self.ser: if self.ser.in_waiting: try: - command = self.ser.read(1).decode(errors='ignore').strip() + command = self.ser.read_all().decode(errors='ignore').strip() print(command) - if command == 'a': + if command(0) == 'a': message = f"{self.current_angle};{self.current_torque};{self.analogInput};{self.currentSetpoint};{self.currentOutput}\n" self.ser.write(message.encode()) - if command == 'w': + if command(0) == 'w': self.tare_angle() - if command == 'u': + if command(0) == 'u': time.sleep(5) string = self.ser.read_until(b"u") outCommand = F"u{string}u\n"