Make voltage & temperature test repeatable

This commit is contained in:
2023-04-01 20:51:35 +02:00
parent 750697f4f7
commit 72b3a0e14c
3 changed files with 29 additions and 23 deletions

View File

@ -31,10 +31,10 @@ def recive(bustype="socketcan", channel="can0"):
return message
def waitForUserInput(waitForUserInput):
def waitForUserInput(waitForUserInput, prompt="Ready to start?"):
if waitForUserInput:
readInput = "n"
print("Ready to start ? ")
print(prompt)
while "y" not in readInput:
print("Enter y to start or c to cancel ")
readInput = input(" ")

View File

@ -44,6 +44,7 @@ def verifyNumbers(numberListList):
def tempTest():
while True:
print("====================")
print("starting temperature test ")
canTest.waitForUserInput(True)
@ -61,4 +62,6 @@ def tempTest():
changed.append(((te >> 4) * 0.0625))
print("Interpreted temperatures:")
print(changed)
if canTest.waitForUserInput(True, "Repeat temperature test?") != 0:
break
print("I am done with this shit")

View File

@ -52,6 +52,7 @@ def verifyNumbers(numberListList):
def voltagesTest():
print("====================")
print("starting voltage test pls but 3.500 as reference value")
while True:
canTest.waitForUserInput(True)
voltages = getBatteryVoltageOverCan() # rausfinden welche id der Slave hat
allVoltages = []
@ -60,3 +61,5 @@ def voltagesTest():
verifyNumbers(allVoltages)
print("I am done with this shit")
if canTest.waitForUserInput(True, "Repeat voltage test?") != 0:
break