Limmit which screen text is displayed on
Posted: Fri Apr 11, 2014 11:43 pm
Ok next question, Im using the new screen layout and wanted to put a large text of the temp1 in the extra space provided the below code does that for me but the problem is it is drwn over the splash screen and any sub menus.
Is there a way to get it to display on just the home screen..
Is there a way to get it to display on just the home screen..
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 <Humidity.h>
#include <DCPump.h>
#include <ReefAngel.h>
#include <ReefAngel_Colors.h>
#include <ReefAngel_CustomColors.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.Use2014Screen();
ReefAngel.AddDateTimeMenu();
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port3Bit | Port7Bit | Port8Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit | Port7Bit | Port8Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port4Bit | Port5Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = Port2Bit | Port4Bit | Port5Bit | Port6Bit;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Ports that are always on
ReefAngel.Relay.On( Port7 );
ReefAngel.Relay.On( Port8 );
////// Place additional initialization code below here
ReefAngel.CustomLabels[0]="ATO";
ReefAngel.CustomLabels[1]="Heater";
ReefAngel.CustomLabels[2]="FAN";
ReefAngel.CustomLabels[3]="Kessil";
ReefAngel.CustomLabels[4]="LED";
ReefAngel.CustomLabels[5]="Refugium";
ReefAngel.CustomLabels[6]="F Pump";
ReefAngel.CustomLabels[7]="C Pump";
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardATO( Port1 );
ReefAngel.StandardHeater( Port2 );
ReefAngel.StandardFan( Port3 );
ReefAngel.DayLights( Port4 );
ReefAngel.ActinicLights( Port5 );
ReefAngel.MoonLights( Port6 );
////// Place your custom code below here
ReefAngel.Relay.Set(Port5, !ReefAngel.Relay.Status(Port4));
////// Place your custom code above here
char text[7];
byte TempColor = COLOR_GREEN;
int TempLow = InternalMemory.HeaterTempOn_read();//789
int TempHigh = InternalMemory.HeaterTempOff_read();//797
ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
if(ReefAngel.Params.Temp[T1_PROBE] < TempLow){TempColor = COLOR_BLUE;}
if((ReefAngel.Params.Temp[T1_PROBE] >= TempLow)&&(ReefAngel.Params.Temp[T1_PROBE] <= TempHigh)){TempColor = COLOR_GREEN;}
if(ReefAngel.Params.Temp[T1_PROBE] > TempHigh){TempColor = COLOR_RED;}
ReefAngel.LCD.DrawHugeNumbers(TempColor, COLOR_WHITE, 30, 70, text);
// This should always be the last line
ReefAngel.Portal( "xxxxxx" );
ReefAngel.ShowInterface();
}