I still don't see your desired sequence.
It seems to be some
onDay, offDay, onNight, offNight
these are 4 variables why do you need a 4 x 4 array?
I still don't see your desired sequence.
It seems to be some
onDay, offDay, onNight, offNight
these are 4 variables why do you need a 4 x 4 array?
Correct me if im wrong for doing it this way. the way its setup,
timerTimes[0][0] would be timer 1 ontimeDAY
timerTimes[3][2] would be timer 4 ontimeNight
maybe it made more sense to me than just timerTimes[16] . i could maybe use timerTimes[16] and multiply state when passed as argument to the timerTimes[ ] array based on day/night? what would be the generally accept approach to this?
we are back at the beginning:
why do you need to store millis for each "timer"?
for me it sounds more logically to define the interval for each period. I would'nt care about the millis from the previous-previous sequence.
Or in other words: is there any point to have all 16 stored millis at one moment? Will you have any if - any condition - where you use all 16 values at once? Or are you just using the "previous" value and compare it, if it has exceeded a specific interval?
if you are talking about TIME (like 1600 for 16:00) i would use an array of struct
struct Timer
{
uint16_t on;
uint16_t off;
};
you need 4 timers?
Timer timer[4];
and access the member variable:
timer[i].on = 1600;
at least it makes the code more readable than a
timer[i][0] = 1600;
what could .on mean? may be something like the on time
what might [0] mean? Anything.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.