Page 1 of 1

How to set port status based on other port status

Posted: Sat Jun 30, 2012 12:01 pm
by btorrenga
It seems these should be simple to code, but I can't wrap my head around it.

Two things I want to do:

1) I want to turn a port on whenever a different port is off. No doubt going to use the "!" boolean somehow, but I don't know which functions.

2) I want to turn a port on for 1 hour before the metal halides come on, and one hour after the metal halides come on. This one is a bit trickier, probably using some math functions.

Any suggestions?

Re: How to set port status based on other port status

Posted: Sat Jun 30, 2012 12:34 pm
by rimai
1)

Code: Select all

ReefAngel.Relay.Set(Port1,!ReefAngel.Relay.Status(Port2));
2)
If you use internal memory:

Code: Select all

  ReefAngel.DelayedStartLights(Port1);
  ReefAngel.ActinicLights(Port2);
If you prefer hardcoded:

Code: Select all

  ReefAngel.MHLights(Port1, 9,0,20,0,5);
  ReefAngel.StandardLights(Port2, 8,0,21,0);

Re: How to set port status based on other port status

Posted: Sat Jun 30, 2012 5:34 pm
by btorrenga
Interesting, but where can I read about how to use DelayedStartLights and ActinicLights functions? Is there a source file with comments I can look into?

Re: How to set port status based on other port status

Posted: Sat Jun 30, 2012 6:52 pm
by rimai
It's inside ReefAngel.cpp