connectd logging

This commit is contained in:
Seth Samuel 2024-12-02 12:43:27 +13:00
parent ba50a8ce69
commit 231862f06b

View file

@ -76,6 +76,11 @@ def runningThread():
print("please check connection to arduino and verify the correct serial port") print("please check connection to arduino and verify the correct serial port")
exit() exit()
csvOut = tkLoggingEnabled.get()
if csvOut == True:
csvFile = open(gameType.value+"_"+str(int(time.time()))+'.csv',"a")
gameType= tkGametype.get() gameType= tkGametype.get()
while not stopThread: while not stopThread:
@ -94,6 +99,7 @@ def runningThread():
if csvOut == True: if csvOut == True:
csvWriteOut(firstRun,carData,csvFile) csvWriteOut(firstRun,carData,csvFile)
firstRun=False firstRun=False
try: try:
toPi.write(str(kmh).encode()+":".encode()) toPi.write(str(kmh).encode()+":".encode())
except: except:
@ -209,12 +215,6 @@ while gameSelected == False:
print("please select a number from the list") print("please select a number from the list")
if csvOut == True:
csvFile = open(gameType.value+"_"+str(int(time.time()))+'.csv',"a")
print("ready:\n") print("ready:\n")