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

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,

Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 95
Posts: 4063
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 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.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

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

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

see - http://www.fgh.si/2/ -
Logged

Rob Tillaart

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

Pages: [1]   Go Up
Jump to: