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