From c8d8118d98b6b254910df3b23f09332a4cf17090 Mon Sep 17 00:00:00 2001 From: Musab Erdem Date: Thu, 18 Jul 2024 10:26:26 +0200 Subject: [PATCH] optimierung --- main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main.py b/main.py index 0f07028..b0d7611 100644 --- a/main.py +++ b/main.py @@ -242,7 +242,7 @@ class ArduinoGUI: com_port = self.combobox_value.get() if com_port: try: - self.arduino = serial.Serial(com_port, 19200, timeout=1) + self.arduino = serial.Serial(com_port, 19200, timeout=2) messagebox.showinfo("Info", "Arduino verbunden an " + com_port) except Exception as e: messagebox.showerror("Fehler", str(e)) @@ -454,8 +454,6 @@ class ArduinoGUI: message = f"{self.current_angle};{self.current_torque};{self.analogInput};{self.currentSetpoint};{self.currentOutput}\n" self.ser.write(message.encode()) time.sleep(0.1) - while self.ser.out_waiting: - pass except Exception as e: print(e) #self.ser.write(b'Hallo\n')