Go Down

Topic: timer and schedule library? (Read 700 times) previous topic - next topic

firestream99

Hi,

I'm new to Arduino and am about to start my first project.  I'm trying to create a library for Arduino that can start scheduled tasks at preset times and dates that is compatible with a crestron home automation system that has similar schedules already set. I'll take care of getting those schedules into the arduino. here's my needs so far.

1) schedule function to run based on a specific Date and time such as:
  - Every day at 2:00 PM
  - Every day at 1:00 AM in all months except Jan, Feb, Mar.
  - Once on May 26th, 2011 at 11:33 PM
  - 1 hour after sunset
  - Every day at sunrise minus 1 hour

Notice the astronomical time needs in some of the examples. I guess I will need to calculate this based on longitude and latitude.

Does anyone know of a library that will help with this? I found http://www.arduino.cc/playground/Code/Time but I'm not sure if this will do everything or if there is something better.

Thx,


Jack Christensen

If you will download that Time library you linked, you will see there is also a second library included called TimeAlarms which may be of some help. I haven't tried TimeAlarms, but I do like the main Time library a lot. I'd be surprised if it'll help with things like sunrise and sunset, so like you say, there's probably some additional work to be done there, regardless.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

robtillaart

Quote
1 hour after sunset

you could use a photo resistor to "detect" sunset/sunrise ... :)  and use that value for the next day.

see - http://www.fgh.si/2/ -
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Go Up