def __init__(self):
existing_ports = SerialInterface.serial_ports()
if len(existing_ports) > 1:
print('WARN! more than one serial port is active on the computer. Blindly using first one...')
if len(existing_ports) is 0:
print('ERR! no serial ports found on the computer! Exiting...')
exit(-1)
print('using port: ' + existing_ports[0])
port_name = existing_ports[0]
self.ser = serial.Serial(port=port_name, baudrate=9600, bytesize=BYTE_SIZE, parity=serial.PARITY_NONE,
stopbits=STOP_BITS, write_timeout=10, timeout=10)
self.sampler = Sampler()
评论列表
文章目录