program will let you know if arduino disconnected
This commit is contained in:
@@ -87,7 +87,7 @@ while connectedWebSocket == False:
|
||||
|
||||
while connectedArduino == False:
|
||||
try:
|
||||
toPi=serial.Serial(SERIAL_PORT,115200) #connect to arduino
|
||||
toPi=serial.Serial(SERIAL_PORT,115200,timeout=2) #connect to arduino
|
||||
connectedArduino = True
|
||||
except:
|
||||
print("please check connection to arduino and verify the correct serial port")
|
||||
@@ -115,6 +115,8 @@ while True:
|
||||
if csvOut == True:
|
||||
csvWriteOut(firstRun,carData,csvFile)
|
||||
firstRun=False
|
||||
|
||||
toPi.write(str(kmh).encode()+":".encode())
|
||||
try:
|
||||
toPi.write(str(kmh).encode()+":".encode())
|
||||
except:
|
||||
print("arduino disconnected please check connection\n")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user