Optimierung der LSP Schnittstelle
This commit is contained in:
8
main.py
8
main.py
@@ -444,14 +444,14 @@ class ArduinoGUI:
|
|||||||
if self.ser:
|
if self.ser:
|
||||||
if self.ser.in_waiting:
|
if self.ser.in_waiting:
|
||||||
try:
|
try:
|
||||||
command = self.ser.read(1).decode(errors='ignore').strip()
|
command = self.ser.read_all().decode(errors='ignore').strip()
|
||||||
print(command)
|
print(command)
|
||||||
if command == '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"
|
||||||
self.ser.write(message.encode())
|
self.ser.write(message.encode())
|
||||||
if command == 'w':
|
if command(0) == 'w':
|
||||||
self.tare_angle()
|
self.tare_angle()
|
||||||
if command == 'u':
|
if command(0) == 'u':
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
string = self.ser.read_until(b"u")
|
string = self.ser.read_until(b"u")
|
||||||
outCommand = F"u{string}u\n"
|
outCommand = F"u{string}u\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user