I see that I have now DP=90 AP=0 on the RA+ controller but I don't know what that means, I was trying things not sure how supposto be....
I navigate to and turn "Lights ON", I can see my relay ports 3 and 4 came on, the LEDs just blink once and dark (10 at evening).
I would need this when I get home, the lights started dimming down but not entirely off yet, and I need to do things in the tank.....
here is what I have now:
Code: Select all
#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.SetTemperatureUnit( Celsius ); // set to Celsius Temperature
ReefAngel.AddStandardMenu(); // Add Standard Menu
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port5Bit | Port6Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port3Bit | Port4Bit | Port5Bit | Port6Bit | Port8Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 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( 270 );
// Ports that are always on
ReefAngel.Relay.On( Port7 );
ReefAngel.Relay.On( Port8 );
////// Place additional initialization code below here
ReefAngel.Timer[1].SetInterval(60);
////// Place additional initialization code above here
}
void loop()
{
// ReefAngel.StandardATO( Port1,62 );
ReefAngel.StandardHeater( Port2,240,255 );
ReefAngel.StandardLights( Port3,8,55,20,5 );
ReefAngel.StandardLights( Port4,9,55,17,05 );
if (hour()>=10 && hour()<19)
{
ReefAngel.Wavemaker( Port5,5 );
ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
}
else
{
ReefAngel.Relay.Off(Port5);
ReefAngel.Relay.Off(Port6);
}
ReefAngel.PWM.SetChannel( 0, PWMSlope(9,1,19,59,0,100,35,0) );
ReefAngel.PWM.SetChannel( 1, PWMSlope(10,2,16,58,0,100,20,0) );
ReefAngel.PWM.SetChannel( 2, PWMSlope(11,3,14,57,0,100,20,0) );
ReefAngel.PWM.SetChannel( 3, PWMSlope(15,34,19,36,0,70,20,0) );
ReefAngel.PWM.SetChannel( 4, PWMSlope(18,5,23,58,0,100,20,0) );
// ReefAngel.PWM.SetChannel( 5, PWMSlope(10,0,19,45,90,100,1,90) );
////// Place your custom code below here
//Float #1
if (ReefAngel.IO.GetChannel(1)) // if float 1 is triggered
{
ReefAngel.Relay.Off(Port8); // Turn Return off
ReefAngel.Relay.Off(Port7); // Turn Skimmer off
BuzzerOn(); // Turn Buzzer on
}
//Float #2
if (ReefAngel.IO.GetChannel(2)) // if float 2 is triggered
{
ReefAngel.Relay.On(Port1); // Turn AutoTopOff on
ReefAngel.Timer[1].Start(); // Start/Trigger timer
}
// Float #3
if (ReefAngel.IO.GetChannel(3)) // if float 3 is triggered
BuzzerOn(); // Turn Buzzer on
// Float #4
// if (ReefAngel.IO.GetChannel(4)) // if float 4 is triggered
// ReefAngel.Relay.On(Port7); // Turn Skimmer off
// Float #5
// if (ReefAngel.IO.GetChannel(5)) // if float 5 is triggered
{
// ReefAngel.Relay.Off(Port8); // Turn Return off
// BuzzerOn(); // Turn Buzzer on
}
// Timer 1
if (ReefAngel.Timer[1].IsTriggered())
ReefAngel.Relay.Off(Port1); // Turn AutoTopOff off
////// Place your custom code above here
// This should always be the last line
ReefAngel.ShowInterface();
}
void DrawCustomMain()
{
int x,y;
char text[10];
// Dimming Expansion
x = 15;
y = 2;
for ( int a=0;a<6;a++ )
{
if ( a>2 ) x = 75;
if ( a==3 ) y = 2;
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x,y,"Ch :" );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+12,y,a );
ReefAngel.LCD.DrawText( COLOR_DARKGOLDENROD,DefaultBGColor,x+24,y,ReefAngel.PWM.GetChannelValue(a) );
y += 10;
}
pingSerial();
// I/O Expansion
byte bkcolor;
x = 14;
y = 39;
for ( int a=0;a<6;a++ )
{
ReefAngel.LCD.DrawCircleOutline( x+(a*20),y,4,COLOR_MEDIUMORCHID );
if ( ReefAngel.IO.GetChannel(a) ) bkcolor=COLOR_WHITE;
else bkcolor=COLOR_GRAY;
ReefAngel.LCD.FillCircle( x+(a*20),y,2,bkcolor );
}
pingSerial();
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 53, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 53, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();
// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 90, TempRelay );
pingSerial();
// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}
void DrawCustomGraph()
{
}
void BuzzerOn()
{
ReefAngel.PWM.SetActinic((now()%2)*100);
}