feature_lsp_com #8
4
main.py
4
main.py
@@ -272,7 +272,7 @@ class ArduinoGUI:
|
|||||||
serPort = port
|
serPort = port
|
||||||
|
|
||||||
if serPort != None:
|
if serPort != None:
|
||||||
self.ser = serial.Serial(serPort, 19200, timeout=1)
|
self.ser = serial.Serial(serPort, 19200, timeout=1, parity=serial.PARITY_EVEN, stopbits=serial.STOPBITS_TWO)
|
||||||
print(F"Slave Port bereit an {serPort}")
|
print(F"Slave Port bereit an {serPort}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(F"Fehler beim Öffnen des Slave Ports an {serPort}")
|
print(F"Fehler beim Öffnen des Slave Ports an {serPort}")
|
||||||
@@ -447,7 +447,7 @@ class ArduinoGUI:
|
|||||||
if self.ser:
|
if self.ser:
|
||||||
if self.ser.in_waiting:
|
if self.ser.in_waiting:
|
||||||
try:
|
try:
|
||||||
command = self.ser.readline().decode(errors='ignore')
|
command = self.ser.readline().decode(errors='ignore').strip()
|
||||||
print(command)
|
print(command)
|
||||||
if command == 'a':
|
if command == '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"
|
||||||
|
|||||||
Reference in New Issue
Block a user