The Planted Tank Forum - View Single Post - Hunter X's Arduino Whole Tank Controller (52K Warning)
View Single Post
Old 04-09-2014, 05:46 AM   #171
Algae Grower
benjaf's Avatar
PTrader: (0/0%)
Join Date: Mar 2012
Location: Denmark
Posts: 107

Originally Posted by bigd603 View Post
Thanks Benjaf, I didn't do the RTC time stamp at first because I was also worried about a rollover scenario (if it checked if lastXivelyPut >= second() + 9 or something like that) when the second rolled over into the next minute. But thinking about it, I could just have it check if second = 0, 10, 20, 30, 40, or 50. That would give me the same result without worrying about a rollover. Thanks!
You're welcome!
Most RTC libraries also have an option to return a proper timestamp, usually Unix time (seconds since 01-01-1970) or seconds since 01-01-2000 which would be ideal for this use since it doesn't roll over any time soon.
benjaf is online now   Reply With Quote