I need to set an alarm which will trigger 250 days set. I am using the Time.Lib and looking through the document found this:
#define elapsedDays(_time_) ((_time_) / SECS_PER_DAY) // this is number of days since Jan 1 1970
The way I plan to count the days would be to create a variable to initially store the start of the daycount and do something like this
if (elapsedDays () - previouselapsedDays >= 250)
{
//DO SOMTHING
}
the problem is when i did do this it was not compiling, which lead me to believe I cant just use elapsedDays as I have.
Altogether, this seems very fragile.
I’d be saving the start date in EEPROM, that way, even if the board is restarted accidentally, you’ll have a reference to the elapsed duration.
It would be a pity to wait 250 days to find you missed a restart !