Syntax for second relay box feed mode programming

Do you have a question on how to do something.
Ask in here.
Post Reply
estanoche
Posts: 46
Joined: Thu Mar 01, 2012 8:17 pm
Location: Spokane, WA

Syntax for second relay box feed mode programming

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

Re: Syntax for second relay box feed mode programming

Post 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;
Roberto.
estanoche
Posts: 46
Joined: Thu Mar 01, 2012 8:17 pm
Location: Spokane, WA

Re: Syntax for second relay box feed mode programming

Post 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??
estanoche
Posts: 46
Joined: Thu Mar 01, 2012 8:17 pm
Location: Spokane, WA

Re: Syntax for second relay box feed mode programming

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

Re: Syntax for second relay box feed mode programming

Post by rimai »

Correct
Roberto.
Post Reply