Hi there
I would like to start the pump the second I hit the WATERCHANGE_MODE menu for 10 seconds.. so i thought something like that:
if(ReefAngel.DisplayedMenu==WATERCHANGE_MODE) ReefAngel.DosingPump(Port8,1, hour(), minute(), 10);
I also tryed:
byte h = hour();
byte m = minute();
if(ReefAngel.DisplayedMenu==WATERCHANGE_MODE) ReefAngel.DosingPump(Port8,1, h, m, 10);
I am getting no error compiling... but it is not working as expect.
Can someone help me out?
Best regards
Rafa
Newbie question - Doser Code
-
- Posts: 133
- Joined: Sun Mar 09, 2014 11:01 am
- Location: Santos - Brazil
Re: Newbie question - Doser Code
That won't work right for sure. Try this:
Code: Select all
static unsigned long wcDosingTimer;
if (ReefAngel.DisplayedMenu!=WATERCHANGE_MODE) wcDosingTimer=now()+10; // Set time for 10 seconds from now
if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE && now()<wcDosingTimer) { // Start comparing now to timer and dose accordingly
ReefAngel.Relay.On(Port8);
} else {
ReefAngel.Relay.Off(Port8);
}
-
- Posts: 133
- Joined: Sun Mar 09, 2014 11:01 am
- Location: Santos - Brazil
Re: Newbie question - Doser Code
Tks Inevo!!