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"