Commit 5dfa3efb authored by Hugo Hörnquist's avatar Hugo Hörnquist

Fix double hit problem.

parent 756098c2
......@@ -141,9 +141,19 @@ def main():
wait_for_bottle_place()
print "BOTTLE PLACED"
end_time = time_ms()
# Wait for bottle placed is in a loop because if the time
# is under 1 secound then we want to wait again. This is
# to prevent a finger or similar from stopping the time.
while True:
wait_for_bottle_place()
print "BOTTLE PLACED"
end_time = time_ms()
t = (end_time - start_time) / 1000.0
if t > 1:
# Allow timing to halt
break
t = (end_time - start_time) / 1000.0
print "Hafvtid: {0} s".format(t)
last_time = t
lcd_info("Avvakta", last_time)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment