Page 1 of 1

Skimmate collector code question

Posted: Tue May 19, 2015 9:35 am
by joshlawless
I've got the Avast skimmate collector hooked up to the ATO high port, and researched how best to code for its water level sensor. The code I found:

Code: Select all

if(!ReefAngel.HighATO.IsActive()) 
  {
    ReefAngel.Relay.Override(Port3,0);
  }
  
else
  {
    ReefAngel.Relay.On(Port3);
  } 
includes an "else" clause, the purpose for which I don't understand. If I leave the else out, then the code will simply override the skimmer pump to off when the collector is full. Including the else seems like it would switch the skimmer on (immediately) if it were ever clicked off, and would override the delayed-on functionality for the skimmer.

Am I missing something that would explain why that "else" should be included?

Re: Skimmate collector code question

Posted: Tue May 19, 2015 11:14 am
by rimai
Not every code will work for everyone. That's the beauty of open source :)
Use the way that fits you best and go for it.

Re: Skimmate collector code question

Posted: Tue May 19, 2015 12:35 pm
by lnevo
DelayedOn is only going to work after a mode change or power up. You can use the else and have that be the only function to control your skimmer. You can replace the On with DelayedOn, or you can call On/DelayedOn earlier in the code and then the if statement to override. As roberto said it's all based on the code you have and your preference.