feature_lsp_com #8
4
main.py
4
main.py
@@ -450,12 +450,12 @@ class ArduinoGUI:
|
||||
if self.ser:
|
||||
if self.ser.in_waiting:
|
||||
try:
|
||||
command = self.ser.read(2).decode(errors='ignore').strip()
|
||||
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(1)
|
||||
time.sleep(0.1)
|
||||
while self.ser.out_waiting:
|
||||
pass
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user