I am searching for a code that will allow me to dim an LED on over 15minutes then dim off over 15 minutes, then turn off for one hour, and then repeat the exact same changes until I turn the arduino and LED off. I have searched on the arduino forum, bildr and other sites but I'm having a difficult time finding something to start with that is simplified.
I have already set the clock on the RTC and have used it in the past.
If someone could point me in the right direction I would greatly appreciate it - even if just a link to get started on the right code.
What I have found on line thus far seems to be for longer periods of time (ie: controls for sunrise and sunset). These parameters are much greater than what I need.
What I have found on line thus far seems to be for longer periods of time (ie: controls for sunrise and sunset). These parameters are much greater than what I need.
Changing the interval should be trivial.
Think about what is involved. You have a time that fading is to start. You have a time that fading is to end. You have some number of steps to fade up to, or down to. That defines the interval between steps.
Knowing the start time, the current step, and the time until the next step, you know whether it is time to step, or not. If it isn't, there is nothing to do. If it is, you reset the last step time, and perform the step.
If the purpose of getting the time from the RTC, is to syncronize to real time, for example, start dimming at precisely 4:00 and then 5:30 and then 7:00, etc., then you need to set up some kind of wait or synch to RTC time before you run John's code above. Otherwise, no problem.