Optimierung der LSP Schnittstelle

This commit is contained in:
2024-07-22 11:41:57 +02:00
parent 74c7746142
commit 582bdec6c5

View File

@@ -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"