Exception handle

This commit is contained in:
HeshamTB 2018-12-04 17:38:13 +00:00
parent 3660a2e9eb
commit ef8332f253

View File

@ -109,6 +109,13 @@ def OpenShifter():
ser.write('o')
ser.close()
except Exception as ex:
print('[ Error ] Can not connect to Arduino at /dev/ttyUSB0 ..')
try:
ser = serial.Serial('/dev/ttyUSB1',9600)
ser.open()
ser.write('o')
ser.close()
except:
print('[ Error ] Can not connect to Arduino at /dev/ttyUSB1 ..')
def loadNames():