I am looking for some advice creating a simple countdown timer.
I have a 4Dsystems display, so I will be able to set the duration of the timer, start the timer and show the remaining time in digits. I will only need to use seconds for the time to simplify the code.
Like to get some advice or suggested libraries to achieve this the best way.
I will only need to use seconds for the time to simplify the code.
Is the Arduino accurate enough? It's clock is not all that great. And, it resets every time the Arduino does.
Determining if enough time has elapsed to decrement the number of seconds remaining is easy - now (millis()) minus then (the last millis() value when the number of seconds changed) is greater than or equal one second (1000 milliseconds).
Decrementing the value is trivial. Recording when you did that is trivial.
You don't need any libraries - just a few functioning gray cells.
PaulS:
Is the Arduino accurate enough? It's clock is not all that great. And, it resets every time the Arduino does.
Determining if enough time has elapsed to decrement the number of seconds remaining is easy - now (millis()) minus then (the last millis() value when the number of seconds changed) is greater than or equal one second (1000 milliseconds).
Decrementing the value is trivial. Recording when you did that is trivial.
You don't need any libraries - just a few functioning gray cells.
Thanks Paul, I wont need extreme accuracy if its off by a couple seconds it wont be a problem. Basically I would set the time for 60Seconds, start the countdown which will turn on an LED and when the timer expires turn off the LED.
That breakdown has helped me understand a bit better, I'll give that a try, thanks