Optimierung der LSP Schnittstelle

This commit is contained in:
2024-07-22 11:49:23 +02:00
parent 6013acc226
commit 729bf18aec

View File

@@ -444,7 +444,9 @@ class ArduinoGUI:
if self.ser: if self.ser:
if self.ser.in_waiting: if self.ser.in_waiting:
try: try:
command = self.ser.readall().decode(errors='ignore').strip() command = self.ser.read_all().decode(errors='ignore').strip()
while self.ser.in_waiting:
pass
print(command) print(command)
if command[0] == 'a': if command[0] == 'a':
message = f"{self.current_angle};{self.current_torque};{self.analogInput};{self.currentSetpoint};{self.currentOutput}\n" message = f"{self.current_angle};{self.current_torque};{self.analogInput};{self.currentSetpoint};{self.currentOutput}\n"