Page 1 of 1
How to get Lights on/off on RA controller?
Posted: Sun Mar 31, 2013 10:08 am
by Express Reef
Good Day All,
I`m new and I know zero about coding? Any advice how i can teach myself to code? I want to have the function Lights on/off on my RA controller. via the Head unit... how do I do it??? Still dont get my wifi to work but i need a rooter to get it to work...
Re: How to get Lights on/off on RA controller?
Posted: Sun Mar 31, 2013 11:19 am
by rimai
The easiest way is to add the standard menu in the setup() section of your code.
Re: How to get Lights on/off on RA controller?
Posted: Sun Mar 31, 2013 11:56 am
by Express Reef
I dont know how to do it... is there not an easier way??? This whole code thing is too difficult for me... no program or app that can do the coding???
Re: How to get Lights on/off on RA controller?
Posted: Sun Mar 31, 2013 12:06 pm
by rimai
Use the wizard:
http://forum.reefangel.com/viewtopic.php?f=8&t=1297
The preloaded code does that too.
Have you played around with the preloaded code yet?
Re: How to get Lights on/off on RA controller?
Posted: Sun Mar 31, 2013 1:34 pm
by Express Reef
Hi Roberto,
I get an error... sketch to big!
#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 <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();
ReefAngel.SetTemperatureUnit( Celsius ); // set to Celsius Temperature
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port6Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 300 );
// Ports that are always on
ReefAngel.Relay.On( Port7 );
ReefAngel.Relay.On( Port8 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardLights( Port1,9,15,18,15 );
ReefAngel.StandardLights( Port2,9,45,18,15 );
ReefAngel.StandardLights( Port3,10,15,17,30 );
ReefAngel.StandardLights( Port4,10,45,18,0 );
ReefAngel.StandardFan( Port5,252,260 );
ReefAngel.StandardHeater( Port6,250,255 );
ReefAngel.PWM.SetDaylight( MoonPhase() );
ReefAngel.PWM.SetActinic( MoonPhase() );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "Express Reef" );
ReefAngel.ShowInterface();
}
Re: How to get Lights on/off on RA controller?
Posted: Sun Mar 31, 2013 5:00 pm
by rimai
The standard RA doesn't have enough memory to have both wifi and standard menu, so you will need to pick one or the other.
The other solution is to upgrade to RA+.
Re: How to get Lights on/off on RA controller?
Posted: Wed Apr 03, 2013 11:48 am
by Express Reef
Hi Roberto,
I got the code to work...
#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 <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();
ReefAngel.SetTemperatureUnit( Celsius ); // set to Celsius Temperature
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port6Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 300 );
// Ports that are always on
ReefAngel.Relay.On( Port7 );
ReefAngel.Relay.On( Port8 );
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardLights( Port1,9,15,18,15 );
ReefAngel.StandardLights( Port2,9,45,18,15 );
ReefAngel.StandardLights( Port3,10,15,17,30 );
ReefAngel.StandardLights( Port4,10,45,18,0 );
ReefAngel.StandardFan( Port5,252,260 );
ReefAngel.StandardHeater( Port6,250,255 );
////// Place your custom code below here
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "Express Reef" );
ReefAngel.ShowInterface();
}
I Just took out the following
ReefAngel.PWM.SetDaylight( MoonPhase() );
ReefAngel.PWM.SetActinic( MoonPhase() );
Re: How to get Lights on/off on RA controller?
Posted: Wed Apr 03, 2013 11:49 am
by Express Reef
How Can I edit the default menue?
Re: How to get Lights on/off on RA controller?
Posted: Wed Apr 03, 2013 11:50 am
by rimai
Re: How to get Lights on/off on RA controller?
Posted: Sat Apr 06, 2013 7:05 am
by Express Reef
Hi Roberto,
What can be wrong? When I select Lights Off on my RA Controller nothing happens???
Re: How to get Lights on/off on RA controller?
Posted: Sat Apr 06, 2013 8:56 am
by rimai
Lights off can be misleading

It doesn't mean turn lights off when it is on. It means cancel the turn on mode.
So, if you use the lights on to override it on, the lights off simply cancels that mode.