From 4b093e86de89a0a2094fc2110ea2a95434455233 Mon Sep 17 00:00:00 2001 From: Musab Erdem Date: Thu, 18 Jul 2024 10:22:42 +0200 Subject: [PATCH] optimierung --- main.py | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/main.py b/main.py index 840f8cb..0f07028 100644 --- a/main.py +++ b/main.py @@ -469,27 +469,9 @@ class ArduinoGUI: time.sleep(0.1) def lsp_communication_loop(self): + time.sleep(10) while self.running: - if self.ser: - if self.ser.in_waiting: - try: - command = self.ser.readline().decode(errors='ignore').strip() - print(command) - if command == 'a': - 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') - else : - try: - pass - self.connect_lsp() - except Exception as e: - print(e) + pass def send_pid_parameters(self):