Timer Question

What is the best way to program the Arduino to do a task every 3 or 5 days. This is assuming it will be on the entire time.

Depends on a number of factors including how accurate you want it, if it needs to do anything in between, and if you want it to do it at a specific time, or just 3-5 days from when you reset/power it on.

An approximate time is good. I just want it to run a routine on the 3rd or 5th day from the last time it was reset.

I would also like to do this (if possible) without adding a clock chip to a rats nest of wires.

Overall it does not have to be precise just close.

You can use something like the TimeAlarms library, but without an RTC, it's not going to be too accurate.

Alternatively, you can use the concept demonstrated within the Blink Without Delay example and just reset it/power it on once, around the time you want it to happen. This isn't anymore accurate, though.


Did you get your Timealarms.h timer working as desired?

I'm testing it, but the hard coded sketch time is not the time that results when viewing the Uno's time on an LCD display, after uploading.