Seconds Countdown Timer - Is Millis The Trick?

I'm wanting to create a very basic countdown timer that goes from 15:00 down to 0:00. No milliseconds. Just minutes and seconds.

Is there a particular method that's most reliable for updating the display once per second?

What I'd like to avoid: An oddly staggered "seconds" number. I recall seeing a cheap timer that would be like "5 ... 4 ... 3.2.....1"

I'll be using either ATMega328, 32u4, or NodeMCU/ESP8266 and would like to avoid a RTC for simplicity if possible.

Yes, millis and the "Blink Without Delay" paradigm is what you want here.

ok, that will be too easy. I've used that paradigm many times, but didn't know how actual it was.

Ok I have a chunk of code running quite awesomely.

How will the timings be affected if I run it on a LilyPad with approx 3.7v? (the Lilypads I have don't have a regulator, but specify 2.7v-5.5v on the +.

(I realize that once the power drops below a certain voltage, the pixels will stop working and I'll need to swap with a charged battery)

keith204:
I'm wanting to create a very basic countdown timer that goes from 15:00 down to 0:00. No milliseconds. Just minutes and seconds.

Is there a particular method that's most reliable for updating the display once per second?

Internal timing?

With many Arduino boards like all "R3" boards (UNOR3 or MEGA R3), the internal clocking might be inaccuarate up to 0.8%, this is 8 milliseconds in 1000 milliseconds.

So "one second" in internal clocing bmight be something from 992 milliseconds to 1008 milliseconds, actually.

Would that be OK?

Or do you need the one-second update more precisely than that?

jurs:
Would that be OK?

That sounds like wizardry to me, so I won't ask any more questions.

But yes, that precision would work well. If each second was 700 seconds, that might be weird.

Though, I was hoping that each second would be a bit closer to the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the cesium 133 atom.

ok that was from Wikipedia

By default, the Internal RC Oscillator provides an approximate 8.0 MHz clock. Though voltage
and temperature dependent, this clock can be very accurately calibrated by the user. See Table
28-1 on page 317 for more details.

OK. That's from Section 8.6 of the Atmega 328 datasheet. :slight_smile:
It says on page 317 that +/-1% is achievable

...R