Hey guys,
How can I check the status of a port and then change the status of another port depending on it?
Example:
Check Port 8 (to see if its ON or OFF)
if OFF turn off Port 7.
I tried something like this but it didn't compile (because im not a real coder )
if (ReefAngel.Relay.status(Port8) = Off)
{
ReefAngel.Relay.Off(Port7);
}
Thanks.
Jeremiah
Link status of two different ports
Re: Link status of two different ports
Try this:
Code: Select all
ReefAngel.Relay.Set(Port7,ReefAngel.Relay.Status(Port8));
Roberto.
Re: Link status of two different ports
Thanks Robert but that won't work for what I need (sorry I wasn't very clear ).
I need a failsafe to where my recirculating skimmer pump WON'T turn on (or stay on) if my Return pump is OFF. However, there are times where the Return will be ON but I want the Skimmer OFF so I can't tie the status to each other in absolute terms. Just tied together if the Return is OFF. Any ideas? Thanks.
Jeremiah
I need a failsafe to where my recirculating skimmer pump WON'T turn on (or stay on) if my Return pump is OFF. However, there are times where the Return will be ON but I want the Skimmer OFF so I can't tie the status to each other in absolute terms. Just tied together if the Return is OFF. Any ideas? Thanks.
Jeremiah
Re: Link status of two different ports
Your original code was perfect except for two things...
status should be Status and = should be ==
Try that.
status should be Status and = should be ==
Try that.
Re: Link status of two different ports
Thanks Lee. I get:
Lees_altered.cpp: In function 'void loop()':
Lees_altered:329: error: 'Off' was not declared in this scope
when I try to compile.
if (ReefAngel.Relay.Status(Port7) == Off)
{
ReefAngel.Relay.Off(Port5);
}
BTW...Happy Holidays guys. Thanks for responding given this time of year. You guys ROCK!
Jeremiah
Lees_altered.cpp: In function 'void loop()':
Lees_altered:329: error: 'Off' was not declared in this scope
when I try to compile.
if (ReefAngel.Relay.Status(Port7) == Off)
{
ReefAngel.Relay.Off(Port5);
}
BTW...Happy Holidays guys. Thanks for responding given this time of year. You guys ROCK!
Jeremiah
Re: Link status of two different ports
Thanks Roberto. I tried that earlier and it compiled but functionality-wise it didn't work.
Jeremiah
Jeremiah
Re: Link status of two different ports
so weird...not ruling out user error but...
== 0 compiles but doesn't work.
!= 1 compiles and works fine.
Guess this is closed for now. Thanks guys.
== 0 compiles but doesn't work.
!= 1 compiles and works fine.
Guess this is closed for now. Thanks guys.
Link status of two different ports
If the port is in Auto mode it will be status 2...maybe?