How to set port status based on other port status

Do you have a question on how to do something.
Ask in here.
Post Reply
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

How to set port status based on other port status

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

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

Post 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);
Roberto.
btorrenga
Posts: 100
Joined: Mon Apr 16, 2012 10:22 pm

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

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

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

Post by rimai »

It's inside ReefAngel.cpp
Roberto.
Post Reply