Pages: [1]   Go Down
Author Topic: timer and schedule library?  (Read 657 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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 but I'm not sure if this will do everything or if there is something better.



Grand Blanc, MI, USA
Offline Offline
Faraday Member
Karma: 95
Posts: 4093
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Offline Offline
Shannon Member
Karma: 224
Posts: 13917
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1 hour after sunset
you could use a photo resistor to "detect" sunset/sunrise ... smiley  and use that value for the next day.

see - -

Rob Tillaart

Nederlandse sectie -,77.0.html -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: