update
This commit is contained in:
@@ -15,9 +15,10 @@ class ComportService:
|
||||
if special_port != "":
|
||||
self.__working = special_port
|
||||
else:
|
||||
print(serial.tools.list_ports.comports())
|
||||
while self.__working == []:
|
||||
self.__com_name = serial.tools.list_ports.comports()[self.__pos]
|
||||
if "USB-Serial Controller" or "Prolific USB-Serial Controller" in self.__com_name:
|
||||
if "NXP ARM mbed" in self.__com_name:
|
||||
self.__working = self.__comport.pop(self.__pos)
|
||||
else:
|
||||
self.__pos += 1
|
||||
|
||||
@@ -14,7 +14,7 @@ class Com:
|
||||
self.str_input = ""
|
||||
self.str_get_input = ""
|
||||
self.xs = ""
|
||||
self.__comport = '/dev/ttyUSB0'
|
||||
self.__comport = '/dev/ttyACM0'
|
||||
|
||||
def connect(self, baudrate, special_port):
|
||||
try:
|
||||
@@ -47,7 +47,7 @@ class Com:
|
||||
return 0
|
||||
|
||||
def decode_int(self, value):
|
||||
self.i = int(value, base = 16)
|
||||
self.i = int(value, base=16)
|
||||
return self.i
|
||||
|
||||
def decode_float(self, value):
|
||||
|
||||
Reference in New Issue
Block a user