Page 1 of 1

Syntax for second relay box feed mode programming

Posted: Sat Mar 24, 2012 4:33 pm
by estanoche
OK - so I'm sure this is simple, but I can't seem to figure out for the life of me how to attribute ports on my second relay box with some of the auto features (ie feed mode, water change mode, etc)..

Help!! I know its gotta be syntax...

Here's what I "want" to do:

ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port3Bit | Port7Bit;
ReefAngel.LightsOnPorts = Port1Bit | Port2Bit | Port3Bit;
ReefAngel.FeedingModePorts = Box1_Port3Bit | Box1_Port7Bit;
ReefAngel.WaterChangePorts = Box1_Port3Bit | Box1_Port7Bit | Port8Bit;


But the arduino programmer is kicking the Box1_port syntax out like its invalid... :cry:

Re: Syntax for second relay box feed mode programming

Posted: Sat Mar 24, 2012 6:06 pm
by rimai
You were almost there :)

Code: Select all

 ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port3Bit | Port7Bit;
 ReefAngel.LightsOnPorts = Port1Bit | Port2Bit | Port3Bit;
 ReefAngel.FeedingModePortsE[0] = Port3Bit | Port7Bit;
 ReefAngel.WaterChangePortsE[0] = Port3Bit | Port7Bit | Port8Bit;

Re: Syntax for second relay box feed mode programming

Posted: Sat Mar 24, 2012 9:14 pm
by estanoche
Interesting - so if im understanding this right, you have to keep all the ports for a specific function either on the box #1 or the expansion boxes, not mix them??

what if they are mixed??

Re: Syntax for second relay box feed mode programming

Posted: Sat Mar 24, 2012 9:16 pm
by estanoche
lol nevermind, now that I think about it you can have

ReefAngel.FeedingModePorts = Port1Bit;

and

ReefAngel.FeedingModePortsE(0) = Port1Bit;

Allowing you to have it on multiple boxes...... basically, there needs to be a function for each box, for each mode you want to use, right???

Re: Syntax for second relay box feed mode programming

Posted: Sat Mar 24, 2012 9:32 pm
by rimai
Correct