Here is the demo code I am using....
Code: Select all
// test of scrolling or alternating values onthe custom display
#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 <ReefAngel.h>
#include <IO.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
int timescroll;
byte a;
byte b;
void ScrollTemp(byte x, byte y)
{
ReefAngel.LCD.DrawText(T1TempColor,DefaultBGColor,x,y,"TANK");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T1_PROBE], COLOR_BLACK, x+25, y, 10);
ReefAngel.LCD.DrawText(T2TempColor,DefaultBGColor,x+50,y,"SUMP");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_BLACK, x+75, y, 10);
ReefAngel.LCD.DrawText(T3TempColor,DefaultBGColor,x+105,y,"ROOM");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T3_PROBE], COLOR_BLACK, x+135, y, 10);
}
void DrawCustomMain()
{
//Option 1. scrolling the temperature using time across the display
ReefAngel.LCD.DrawText(T3TempColor,DefaultBGColor,1,10,"TEMP:");
if (second()<=13)
{
timescroll = (60-(3*second()))-59;
ScrollTemp(timescroll, 20);
}
else if (second()<=26)
{
timescroll = ((3*second())-77);
ScrollTemp(timescroll, 20);
}
else if (second()<=39)
{
timescroll = (60-(3*second()))+19;
ScrollTemp(timescroll, 20);
}
else if (second()<=52)
{
timescroll = ((3*second())-155);
ScrollTemp(timescroll, 20);
}
else
{
ScrollTemp(1, 20);
}
// Option 2: alternating the temp display using time
a=second() % 3;
ReefAngel.LCD.DrawText(COLOR_BLACK,DefaultBGColor,1,50,"TEMP:");
if (a==0)
{
ReefAngel.LCD.DrawText(T1TempColor,DefaultBGColor,30,50,"TANK");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T1_PROBE], COLOR_BLACK, 60, 50, 10);
}
else if (a==1)
{
ReefAngel.LCD.DrawText(T2TempColor,DefaultBGColor,30,50,"SUMP");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_BLACK, 60, 50, 10);
}
else if (a==2)
{
ReefAngel.LCD.DrawText(T3TempColor,DefaultBGColor,30,50,"ROOM");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T3_PROBE], COLOR_BLACK, 60, 50, 10);
}
}
void DrawCustomGraph()
{
}
void setup()
{
ReefAngel.Init(); //Initialize controller and start web banner timer
}
void loop()
{
ReefAngel.ShowInterface();
}