I have been looking at PaulTurner911s code for his pumps and I am looking to do something similar. Basically I would like to have one pump do a long pulse between 30% and 80% with 2 second pulses while the other pump is at a constant 30%. After 1 hour I would like the pumps to switch so the constant pump is now pulsing and the pulsing pump is now constant. Also I'd like this to happen between 9am and 10pm.
I know how to set the pump speeds but what I can't figure out is how to switch between the two "modes". So I am thinking of having two modes coded like this;
Code: Select all
if mode=1 {
ReefAngel.PWM.SetDaylight( LongPulseMode(30,80,2,true));
ReefAngel.PWM.SetActinic(30);
}
if mode=2 {
ReefAngel.PWM.SetDaylight(30);
ReefAngel.PWM.SetActinic( LongPulseMode(30,80,2,true));
}
I understand these if statements won't work but this is the idea I am going for. Then I just want to flip between modes 1 and 2 at the top of every hour while between 8am and 10pm. So I was thinking something like this...
Code: Select all
if (now()%SECS_PER_HOUR==0 && now()%SECS_PER_DAY > 28800 && now()%SECS_PER_DAY <= 72000)
{
// code to change modes goes here
}
The above code seems way off to me so any guidance would be greatly appreciated!