Hi there, I'm trying to make a somewhat simplified version of this moon thing: http ://blogs.msdn.com/coding4fun/archive/2009/08/18/9727393.aspx . Instead of using a date/time chip, however, I'd like to just keep a counter running. I was wondering, does that seem like a reasonable approcah? The millis() function seems like the way to go, but I'm a little worried about the overflow after "about 50 days" thing. Is there a way to manually reset the millis function in a controlled way so that I can set it to loop without screwing up every couple of months? Is there a better way to keep track of a 30 day cycle, without having to set the date and time? (I plan to set the phase on startup by advancing through the phases with a pushbutton). I figure I need the counter to be accurate to .01 days, or 864 seconds. That is, after every 864 seconds it progresses the counter by .01 and when it reaches 29.54 it has cycled through all of the moon phases. Thanks a lot! Sorry if this is a very newbie question... Alex
There's a DateTime library available that may work... http://www.arduino.cc/playground/Code/DateTime
mem has this available... http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1262173131/0
Hmm ok, thanks for that. I think datetime could work, but do you know what happens if you start it up without setting the clock? Will it just start from January 1 1900? That's fine, I'm not interested in the date being kept, just the amount of time that has passed. But if the clock needs to be "turned on" somehow then I'm not sure if it's gonna work, because I have no way to set it...
Will it just start from January 1 1900?
I believe so.
but I donno about days of time passing – I use interrupts
with IR triggers and it works well - could trigger an interupt
every 12/24 hours to help maintain accuracy and as an
or perhaps not…
cool project tho’