Exception handle
This commit is contained in:
parent
3660a2e9eb
commit
ef8332f253
11
main.py
11
main.py
@ -109,8 +109,15 @@ def OpenShifter():
|
|||||||
ser.write('o')
|
ser.write('o')
|
||||||
ser.close()
|
ser.close()
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print('[ Error ] Can not connect to Arduino at /dev/ttyUSB1 ..')
|
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():
|
def loadNames():
|
||||||
try:
|
try:
|
||||||
with open("faces/names.json", "r") as read_file:
|
with open("faces/names.json", "r") as read_file:
|
||||||
|
Loading…
Reference in New Issue
Block a user