Browse Source

allow specifying serial device

master
Alex Mikhalev 6 years ago
parent
commit
5a67fe5e8f
  1. 8
      e32_client/ugv.py

8
e32_client/ugv.py

@ -103,9 +103,13 @@ class UGVComms(E32):
continue continue
def main(): 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, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS,
timeout=2.0) timeout=1.0)
ugv = UGVComms(ser) ugv = UGVComms(ser)
ugv.start() ugv.start()
time.sleep(0.2) time.sleep(0.2)

Loading…
Cancel
Save