Adding an expansion relay

Expansion modules and attachments
Post Reply
Spotted
Posts: 100
Joined: Thu May 10, 2012 5:46 am
Location: Sunny (and hot) South Florida

Adding an expansion relay

Post by Spotted »

How would I add an expansion relay to my code? Would I need to run through the wizard again? I have custom code for nutrient transport and also a random wave generator. How would I get these codes back in if I ran through the wizard.
Thanks!!
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Adding an expansion relay

Post by rimai »

You can just add the code to the existing one you have.
To reference the ports on the expansion box, use Box1_Port1 through Box1_Port8
Roberto.
bencollinz
Posts: 140
Joined: Wed Mar 13, 2013 5:36 pm

Re: Adding an expansion relay

Post by bencollinz »

for your reference...

Code: Select all

 void setup()
    {
        // This must be the first line
        ReefAngel.Init();  //Initialize controller
        // Ports toggled in Feeding Mode
        ReefAngel.FeedingModePorts = 0;
        ReefAngel.FeedingModePortsE[0] = 0;
        // Ports toggled in Water Change Mode
        ReefAngel.WaterChangePorts = Port7Bit | Port4Bit | Port5Bit | Port6Bit;
        ReefAngel.WaterChangePortsE[0] = 0;
        // Ports toggled when Lights On / Off menu entry selected
        ReefAngel.LightsOnPorts = 0;
        ReefAngel.LightsOnPortsE[0] = 0;
        // Ports turned off when Overheat temperature exceeded
        ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port7Bit | Port4Bit | Port5Bit | Port6Bit;
        ReefAngel.OverheatShutoffPortsE[0] = 0;
        // Use T2 probe as temperature and overheat functions
        ReefAngel.TempProbe = T2_PROBE;
        ReefAngel.OverheatProbe = T2_PROBE;


        // Ports that are always on
        ReefAngel.Relay.On( Port2 );
        ReefAngel.Relay.On( Port4 );
        ReefAngel.Relay.On( Port5 );
        ReefAngel.Relay.On( Port6 );
        ReefAngel.Relay.On( Box1_Port1 );
        ReefAngel.Relay.On( Box1_Port2 );
        ReefAngel.Relay.On( Box1_Port3 );
        ReefAngel.Relay.On( Box1_Port4 );
        ReefAngel.Relay.On( Box1_Port5 );
        ReefAngel.Relay.On( Box1_Port6 );
        ReefAngel.Relay.On( Box1_Port7 );
        ReefAngel.Relay.On( Box1_Port8 );
}
       
Image
Post Reply