allow specifying serial device
This commit is contained in:
parent
a92cf5cb9c
commit
5a67fe5e8f
@ -103,9 +103,13 @@ class UGVComms(E32):
|
||||
continue
|
||||
|
||||
def main():
|
||||
ser = serial.serial_for_url("/dev/ttyUSB2", baudrate=9600, parity=serial.PARITY_NONE,
|
||||
if len(sys.argv) >= 2:
|
||||
ser_url = sys.argv[1]
|
||||
else:
|
||||
ser_url = "hwgrep://"
|
||||
ser = serial.serial_for_url(ser_url, baudrate=9600, parity=serial.PARITY_NONE,
|
||||
stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS,
|
||||
timeout=2.0)
|
||||
timeout=1.0)
|
||||
ugv = UGVComms(ser)
|
||||
ugv.start()
|
||||
time.sleep(0.2)
|
||||
|
Loading…
x
Reference in New Issue
Block a user