I will place my custom code as I develop it to hopefully help others in their automation and customization efforts.
Webcam Feed:
Setup/Equipment:
RA+ w/ expansions: 2nd relay, salinity, RF, dosers
Tank: Leemar Glass 75 gallon 36"x24"x20"
Sump: 20 gallon long
Refugium: Large Aquafuge
Lighting: 2x Ecotech Radions
Protein Skimmer: ASM G3
Circulation: MP 40
Return: Eheim 1262
Other equipment: BRS Dual Chamber (Carbon & GFO) Reactor, BRS Bio Pellets, RA Dosing
Banners:
New setup tank:
Other stats:
WL: http://forum.reefangel.com/status/chart ... &filter=WL
Coding Plan:
Custom screen in progress
Code: Select all
void DrawCustomMain()
{
byte x = 6;
byte y = 2;
byte t;
char text[7];
/* Drawing this:
01/01/12 00:00:00 AM
----------------------
Disp 79.9 pH 8.00
Sump 79.9 Sal 0.60
Room 77.7 WtrLvl Ok
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
Moon Waning Crescent
Intensity 88%
Sunrise 06:15
Sunset 18:12
*/
/* Colors used in this script:
DefaultFGColor - For basic font and line
DefaultBGColor - For background color
PHColor - For values that may change
OutletOnBGColor - For okay water level
OutletOffBGColor - For low water level
To change colors, modify these values in ReefAngel_CustomColors.h file
*/
ReefAngel.LCD.DrawDate(6, 2);
ReefAngel.LCD.Clear(DefaultFGColor, 1, 11, 128, 11);
pingSerial();
//ReefAngel.LCD.DrawText(fcolor,bcolor,x,y,"text");
//Line 1 - Display Temp & pH
x = 8;
y = 15;
ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,x,y,"Disp");
x += 30;
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T1_PROBE], PHColor, x, y, 10);
x = 70;
ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,x,y,"pH");
x += 30;
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.PH, PHColor, x, y, 100);
//Line 2 - Sump & Salinity
x = 8;
y += 10;
ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,x,y,"Sump");
x += 30;
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], PHColor, x, y, 10);
x = 70;
ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,x,y,"Sal");
x += 30;
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Salinity, PHColor, x, y, 10);
//Line 3 - Room
x = 8;
y += 10;
ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,x,y,"Room");
x += 30;
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T3_PROBE], PHColor, x, y, 10);
x = 70;
ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,x,y,"Lvl");
x += 30;
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.WaterLevel.GetLevel(), PHColor, x, y, 1);
//Lines 4 and 5 - Relays
x = 12;
y += 15;
// draw main relay
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(x, y, TempRelay);
//Line 3 - Room
x = 8;
y += 20;
ReefAngel.LCD.DrawText(DefaultFGColor,DefaultBGColor,x,y,"Lvl");
x += 30;
ReefAngel.LCD.DrawSingleMonitor(InternalMemory.read(258), PHColor, x, y, 1);
x = 70;
ReefAngel.LCD.DrawSingleMonitor(InternalMemory.read(259), PHColor, x, y, 1);
x += 30;
ReefAngel.LCD.DrawSingleMonitor(topofflevel, PHColor, x, y, 1);
pingSerial();
}
First, paste these variables in the area marked "Place global variable code below/above here"
Code: Select all
////// Place global variable code below here
byte starthr = 8; //start hour for radion cycle (0-23)
byte startmin = 0; //start minute for radion cycle (0-59)
byte endhr = 22; //end hour for radion cycle (0-23)
byte endmin = 0; //end min for radion cycle (0-59)
byte intensity = 80; //intensity of radion cycle (0-100)
////// Place global variable code above here
Code: Select all
/* Radion custom curve
For testing:
ReefAngel.RF.SetChannel( Radion_White, PWMParabola(10,0,21,0,0,75,0) );
ReefAngel.RF.SetChannel( Radion_RoyalBlue, PWMParabola(8,0,22,0,0,100,0) );
ReefAngel.RF.SetChannel( Radion_Red, PWMParabola(11,30,21,0,0,20,0) );
ReefAngel.RF.SetChannel( Radion_Green, PWMParabola(12,0,19,0,0,30,0) );
ReefAngel.RF.SetChannel( Radion_Blue, PWMParabola(9,0,21,0,0,45,0) );
ReefAngel.RF.SetChannel( Radion_Intensity, PWMParabola(8,0,22,0,0,100,0) );
ReefAngel.RF.SetChannel( Radion_RoyalBlue, MoonPhase() );
*/
ReefAngel.RF.UseMemory = false;
ReefAngel.RF.SetChannel( Radion_White, PWMParabola(starthr+2,startmin,endhr-1,endmin,0,intensity*.75,0) );
ReefAngel.RF.SetChannel( Radion_Red, PWMParabola(starthr+3,startmin+30,endhr-1,endmin,0,intensity*.2,0) );
ReefAngel.RF.SetChannel( Radion_Green, PWMParabola(starthr+4,startmin,endhr-3,endmin,0,intensity*.3,0) );
ReefAngel.RF.SetChannel( Radion_Intensity, PWMParabola(starthr,startmin,endhr,endhr,0,intensity,0) );
/* Radion moon cycle
Currently controls RoyalBlue. If normal daylight, run defined parabola based on start and end radion cycle parameters (aka day cycle). If after hours, run moonlight.
*/
if ( (hour() < starthr && (minute() < startmin || startmin == 0) ) || (hour() > endhr && minute() > endmin) ) // If time time is before or after normal daylight cycle
ReefAngel.RF.SetChannel( Radion_RoyalBlue, MoonPhase() ); // Run moonphase on RoyalBlue
else // Or else...
{
ReefAngel.RF.SetChannel( Radion_RoyalBlue, PWMParabola(starthr,startmin,endhr,endmin,0,intensity,0) ); // Run day cycle parabola
ReefAngel.Relay.On(Port4); // And turn on the Vortech
}
if ( second()==0 ) ReefAngel.RF.RadionWrite();
Automated feeding complete
Code: Select all
/* Auto feeding mode starts.
Feeder set for 17:30, start feeding mode at 17:25. */
if ( hour() == 17 && minute() == 25 && second() ==0 ) //if time is 17:25:00
{
ReefAngel.FeedingModeStart(); //start feeding mode
}