Feed Mode for powerhead on 2nd Relay Box

Do you have a question on how to do something.
Ask in here.
Post Reply
mav3rick478
Posts: 39
Joined: Fri Feb 02, 2018 9:00 pm
Location: CA

Feed Mode for powerhead on 2nd Relay Box

Post by mav3rick478 »

So I have a 3rd powerhead being controlled on the second relay box in my setup, it does the timed on and off functions without any issues. I can control it through the Android Reef Angel app but when I activate Feed Mode or Water Change Mode it will not turn off with the rest of my powerheads, skimmer and dosing pump on the first relay box. Can anyone help me out TIA

Here's my current code:

#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <PAR.h>
#include <ReefAngel.h>

////// Place global variable code below here


////// Place global variable code above here


void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.AddStandardMenu(); // Add Standard Menu
ReefAngel.Use2014Screen(); // Let's use 2014 Screen
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port5Bit | Port6Bit | Port8Bit | Box1_Port6;
ReefAngel.FeedingModePortsE[0] = 0;
ReefAngel.FeedingModePortsE[1] = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port8Bit | Box1_Port6;
ReefAngel.WaterChangePortsE[0] = 0;
ReefAngel.WaterChangePortsE[1] = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port7Bit;
ReefAngel.OverheatShutoffPortsE[0] = 0;
ReefAngel.OverheatShutoffPortsE[1] = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
ReefAngel.LightsOnPortsE[0] = 0;
ReefAngel.LightsOnPortsE[1] = 0;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 790 );

// Ports that are always on
ReefAngel.Relay.On( Box1_Port1 );
ReefAngel.Relay.On( Box1_Port2 );
ReefAngel.Relay.On( Port3 );
ReefAngel.Relay.On( Box1_Port3 );
ReefAngel.Relay.On( Port4 );
ReefAngel.Relay.On( Box1_Port4 );
ReefAngel.Relay.On( Port5 );
ReefAngel.Relay.On( Box1_Port5 );
ReefAngel.Relay.On( Port6 );
ReefAngel.Relay.On( Port7 );
ReefAngel.Relay.On( Box1_Port7 );
ReefAngel.Relay.On( Port8 );
ReefAngel.Relay.On( Box1_Port8 );


////// Place additional initialization code below here


////// Place additional initialization code above here
}

void loop()
{
ReefAngel.DosingPumpRepeat( Port1,0,60,660 );
ReefAngel.StandardLights( Port2,0,0,8,0 );
ReefAngel.Wavemaker( Box1_Port6,900 );


////// Place your custom code below here


////// Place your custom code above here

ReefAngel.Portal( "mav3rick478" );
// This should always be the last line
ReefAngel.ShowInterface();
}



// RA_STRING1=null
// RA_STRING2=null
// RA_STRING3=null
// RA_LABEL LABEL_ACTINIC=Actinic
// RA_LABEL LABEL_DAYLIGHT=Daylight
// RA_LABEL LABEL_PORT1=Port 1
// RA_LABEL LABEL_PORT11=Port 11
// RA_LABEL LABEL_PORT12=Port 12
// RA_LABEL LABEL_PORT13=Port 13
// RA_LABEL LABEL_PORT14=Port 14
// RA_LABEL LABEL_PORT15=Port 15
// RA_LABEL LABEL_PORT16=Port 16
// RA_LABEL LABEL_PORT17=Port 17
// RA_LABEL LABEL_PORT18=Port 18
// RA_LABEL LABEL_PORT2=Port 2
// RA_LABEL LABEL_PORT3=Port 3
// RA_LABEL LABEL_PORT4=Port 4
// RA_LABEL LABEL_PORT5=Port 5
// RA_LABEL LABEL_PORT6=Port 6
// RA_LABEL LABEL_PORT7=Port 7
// RA_LABEL LABEL_PORT8=Port 8
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Feed Mode for powerhead on 2nd Relay Box

Post by lnevo »

Set this to whatever PortX_Bit you need

// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port5Bit | Port6Bit | Port8Bit;
ReefAngel.FeedingModePortsE[0] = Port6Bit;
ReefAngel.FeedingModePortsE[1] = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port8Bit;
ReefAngel.WaterChangePortsE[0] = Port6Bit;
ReefAngel.WaterChangePortsE[1] = 0;
mav3rick478
Posts: 39
Joined: Fri Feb 02, 2018 9:00 pm
Location: CA

Re: Feed Mode for powerhead on 2nd Relay Box

Post by mav3rick478 »

lnevo wrote:Set this to whatever PortX_Bit you need

// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port5Bit | Port6Bit | Port8Bit;
ReefAngel.FeedingModePortsE[0] = Port6Bit;
ReefAngel.FeedingModePortsE[1] = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port8Bit;
ReefAngel.WaterChangePortsE[0] = Port6Bit;
ReefAngel.WaterChangePortsE[1] = 0;
Thank you worked like a charm. So that I understand, the line that I transferred the port for my powerhead to is that for what's connected to my Expansion Relay?

Sent from my Pixel XL using Tapatalk
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Feed Mode for powerhead on 2nd Relay Box

Post by lnevo »

Yes, exactly. Each variable controls one relay box. In each one you need to set the bits you want on/off.
Post Reply