im not new to arduino, and have manged to bang out a few workable projects. I need a bit of help on how to approach this new one.
goal (in human speak):
-for my chickens, I need to turn on a light at early dark
-that light needs to be on for four hours (roughly) from first dark.
-the light needs to be off after that fours hours, and not be on again until next dusk, when it start to get dark ( next day - i.e. light goes on about 6p, shuts off 10p, not on again until next night 6p).
-the loop itself cant delay 4 hours - some other stuff needs doing.
Whats working so far in prototype:
-can work the lights on relay control
-i have switch that overrides the light on/off state -works
-photo cell to tell when its dark.
Whats NOT working -
-"time" in the arduino is not my friend. I dont need a super accurate clock. I get its not RTC.
-I basically need a 4 hour count down timer function (when dark, light on from first dark for 4 hours)
-then another timer function to not check the state of dark again until the next day (maybe until light, or another timer?)
-also, not sure if I am putting always increment time values into long vars, if I am going to get an out of memory state one day doing long timers.
help needed -
just a bit of help on approach. I can muddle my way through the code if on the right path - yet I am not too proud to accept code examples if you have interesting stuff