diff --git a/robots/little_john/telemetry/code/monitor/serialselect.py b/robots/little_john/telemetry/code/monitor/serialselect.py index ccc18ca..0825de4 100644 --- a/robots/little_john/telemetry/code/monitor/serialselect.py +++ b/robots/little_john/telemetry/code/monitor/serialselect.py @@ -6,6 +6,7 @@ def selectserial(): import platform import serial import os + import easygui devpatterns = ['ttyACM', 'ttyUSB', 'rfcomm'] targetdevs = [] @@ -34,21 +35,13 @@ def selectserial(): print("Found multiple serial devices: ") for i, dev in enumerate(targetdevs): print(" " + str(i) + ": " + dev) - while True: - try: - selection = int(input("Please enter your selection (as a digit):\n > ")) - if selection >= 0 and selection < len(targetdevs): - break - except KeyboardInterrupt: - sys.exit() - except: - print("Choice unrecognised: please try again:") + message = "Please choose a serial port to recieve data through:" + title = "Found multiple serial ports!" + serialport = easygui.choicebox(message, title, targetdevs) else: print("Only found one likely serial device: " + targetdevs[0]) - selection = 0 - - serialport=targetdevs[selection] - + serialport = targetdevs[0] + try: datafeed = serial.Serial( -- libgit2 0.21.2