Skimmate collector code question

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Skimmate collector code question

Post 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?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Skimmate collector code question

Post 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.
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Skimmate collector code question

Post 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.
Post Reply