Daily lights

Hello,

I'm hoping to use a 20m2 picaxe as a 'calendar' - by which I mean I will have half a dozen or so LEDs that I want to turn on on specific days of the week - to stay on all day.

I feel like this should be easy and that I'm completely missing how to do it, so if anyone can point me in the right direction I will say thankyou shortly after slapping my forehead and saying doh...

many thanks in advance.

Jon
 

rossko57

Senior Member
Before your program can do that, it needs to know what day it is.
You could set up to keep track of time, so that it can tell when the day changes. You'd need some way to start it off right.
Or you could use an external clock/calender chip to do that donkey work, again you would need a way to initially set it.

EDIT maybe you could use a photocell to detect nighttime. If your program remembered how long it was dark for yesterday, you could have a reasonable guess at midnight to rollover the da.y
 

SAborn

Senior Member
Why not just use a DS 1307 RTC chip and have all the data you need, it even allows for leap years.
 

hippy

Ex-Staff (retired)
I would agree with SAborn; use a DS1307 and it is easy. It only needs a very simple human interface to keep it synchronised; a single button. Give it a push to set it to "Sunday 21:00:00" or some other convenient time and a longer push to toggle between GMT and BST.

That's not to say other suggestions such as monitoring daylight and night or using mains cycle counting are wrong - in fact they are quite interesting - but they do have more downsides and will require some thought, experimentation and clever coding. Great for projects which set out to prove those can be done but for a project which simply has to work and can be created as soon and as easily as possible you cannot beat an RTC chip.
 

rossko57

Senior Member
As usual, much depends on the real purpose. For some kind of rolling schedule, leap years are irrelevant (doesn't change the order of weekdays). But for some kind of work rota, maybe public holidays are of interest - RTC won't provide those.
 
Top