Hi all!
I’m lost.
I’m trying to make a simple single button that if you press it once, it goes into state 1. Double press it within 2 seconds, it goes in to state 2. Longer than 2 seconds it goes back to state 0.
I can’t seem to get it from state 1 to state 0 after the 2 second delay.
Your help would be greatly appreciated!
Also, will the millis() count ever get so high that it overflows the Arduino and resets it?
Thanks guys
Chris
This sort of thing is much easier if if you use Bounce and elapsedMillis. Let those libs do the math and timing (any automatically handle internal numerical overflow properly), so you can just respond to the events and know how much time elapsed.
@Cristian_Martinez I think the longest I’ve continuously run something was an UNO that ran for about 23 days straight, so I didn’t even get close to maxing out my use of millis!