Help with custom screen

Do you have a question on how to do something.
Ask in here.
Post Reply
ReeferBee
Posts: 55
Joined: Wed May 08, 2013 6:23 pm
Location: North GA

Help with custom screen

Post by ReeferBee »

Hey guys I'm new here.
I found this code, posted by deckoz2302, of a really nice looking custom main screen.

Code: Select all

//*********************************************************************************************************************************
//Custom Main, Graph & Menu
void DrawCustomMain()
{
  Wire.requestFrom(8,8);
  for (int a=0;a<8;a++)
  {
    if (Wire.available()) SeasonsVar[a]=Wire.receive();
  }

  byte x = 6;
  byte y = 2;
  byte t;
  char text[7];

  ReefAngel.LCD.DrawDate(6, 2);
  ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
  pingSerial();

  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 90, "--------------------");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 126, "--------------------");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 93, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 103, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 113, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 123, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 93, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 103, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 113, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 123, "|");


  ReefAngel.LCD.DrawText(0,255,18,12,"EcoSmart Vortech");
  if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,22,"Constant");
  else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,42,21,"Lagoon");
  else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,21,"Reef Crest");
  else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,22,21,"Short Pulse");
  else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,21,"Long Pulse");
  else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,8,21,"Nutrient Trnsp.");
  else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,23,21,"Tidal Swell");
  else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,0,45,21,"Night");

  ReefAngel.LCD.DrawText(0,255,10,30,"Display");
  ConvertNumToString(text, ReefAngel.Params.Temp1, 10);
  ReefAngel.LCD.DrawLargeText(COLOR_INDIANRED, 255, 10, 40, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,100,30,"pH");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_PLUM, 255, 85, 40, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,43,48,"Salinity");
  ConvertNumToString(text, ReefAngel.Params.Salinity, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN, 255, 49, 58, text, Num8x8);
  pingSerial();

  pingSerial();
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 77, TempRelay);

  ReefAngel.LCD.DrawText(0,255,8,68,"Sump");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp3, COLOR_CORNFLOWERBLUE, 40, 68, 10);

  ReefAngel.LCD.DrawText(0,255,70,68,"Room");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp2, COLOR_CORNFLOWERBLUE, 99, 68, 10);

  ReefAngel.LCD.DrawText(0,255,8,97,"Moon");
  DayAge = MoonAge(day(), month(), year());
  MoonState(DayAge);
  if (ThisPhase == 0) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"New");
  else if (ThisPhase == 1) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waxing Crescent");
  else if (ThisPhase == 2) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"First Quarter");
  else if (ThisPhase == 3) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waxing Gibbous");
  else if (ThisPhase == 4) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Full");
  else if (ThisPhase == 5) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waning Gibbous");
  else if (ThisPhase == 6) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Last Quarter");
  else if (ThisPhase == 7) ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,"Waning Crescent");

  //  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),COLOR_CORNFLOWERBLUE, 105, 109, 1); 

  ReefAngel.LCD.DrawText(0,255,8,109, "Sunrise"); 
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,15,119, SeasonsVar[1]);
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,20,119, ":");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,25,119, SeasonsVar[2]);

  ReefAngel.LCD.DrawText(0,255,75,109,"%");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255, 60, 109, SeasonsVar[0]);

  ReefAngel.LCD.DrawText(0,255,88,109, "Sunset"); 
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,90,119, SeasonsVar[3]);
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,102,119, ":");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,107,119, SeasonsVar[4]);
}
void DrawCustomGraph()
{
}
I'm looking to change some things about it. One big thing I need help with is changing the code to show what mode my wp40 is currently running.

Here is my current code running on my RA +

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.AddStandardMenu();  // Add Standard Menu

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port5Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port5Bit | Port7Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port1Bit | Port2Bit;
    // 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( 820 );


    // Ports that are always on
    ReefAngel.Relay.On( Port5 );
    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,13,0,0,0 );
    ReefAngel.StandardLights( Port2,12,30,0,30 );
    ReefAngel.DosingPumpRepeat( Port3,0,120,60 );
    ReefAngel.DosingPumpRepeat( Port4,29,120,60 );
    ReefAngel.StandardHeater( Port6,780,792 );
    ////// Place your custom code below here
    if (hour()>=8 && hour()<12)
{
  ReefAngel.PWM.SetDaylight( TidalSwellMode(60,true) ); // Tidal Swell at 60% on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(60,false) ); // Tidal Swell at 60% on anti-sync mode
}
else if (hour()>=12 && hour()<16)
{
  ReefAngel.PWM.SetDaylight( ReefCrestMode(80,20,true) ); // ReefCrest at 80% + - 20 on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(80,20,false) ); // ReefCrest at 80% + - 20 on anti-sync mode
}
else if (hour()>=16 && hour()<17)
{
  ReefAngel.PWM.SetDaylight( NutrientTransportMode(75,90,2000,true) ); // Nutrient Transport on sync mode
  ReefAngel.PWM.SetActinic( NutrientTransportMode(75,90,2000,false) ); // Nutrient Transport on anti-sync mode
}
else if (hour()>=17 && hour()<20)
{
  ReefAngel.PWM.SetDaylight( ReefCrestMode(80,20,true) ); // ReefCrest at 75% + - 20 on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(80,20,false) ); // ReefCrest at 75% + - 20 on anti-sync mode
}
else if (hour()>=20 && hour()<24)
{
  ReefAngel.PWM.SetDaylight( TidalSwellMode(60,true) ); // Tidal Swell at 60% on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(60,false) ); // Tidal Swell at 60% on anti-sync mode
}
else
{
  ReefAngel.PWM.SetDaylight( LongPulseMode(0,40,10,true) ); // Long pulse at 40% with 10s pulse on syncy mode
  ReefAngel.PWM.SetActinic( LongPulseMode(0,40,10,false) ); // Long pulse at 40% with 10s pulse on on anti-sync mode
}  

    ////// Place your custom code above here

    // This should always be the last line
    ReefAngel.ShowInterface();
}
thanks so much!
Barry

Current tank info: 150g mixed reef

"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Help with custom screen

Post by rimai »

This should get you started:

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

byte vtechmode=0;

////// Place global variable code above here


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    ReefAngel.AddStandardMenu();  // Add Standard Menu

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port5Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port5Bit | Port7Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port1Bit | Port2Bit;
    // 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( 820 );


    // Ports that are always on
    ReefAngel.Relay.On( Port5 );
    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,13,0,0,0 );
    ReefAngel.StandardLights( Port2,12,30,0,30 );
    ReefAngel.DosingPumpRepeat( Port3,0,120,60 );
    ReefAngel.DosingPumpRepeat( Port4,29,120,60 );
    ReefAngel.StandardHeater( Port6,780,792 );
    ////// Place your custom code below here
    if (hour()>=8 && hour()<12)
{
  vtechmode=6;
  ReefAngel.PWM.SetDaylight( TidalSwellMode(60,true) ); // Tidal Swell at 60% on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(60,false) ); // Tidal Swell at 60% on anti-sync mode
}
else if (hour()>=12 && hour()<16)
{
  vtechmode=2;
  ReefAngel.PWM.SetDaylight( ReefCrestMode(80,20,true) ); // ReefCrest at 80% + - 20 on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(80,20,false) ); // ReefCrest at 80% + - 20 on anti-sync mode
}
else if (hour()>=16 && hour()<17)
{
  vtechmode=5;
  ReefAngel.PWM.SetDaylight( NutrientTransportMode(75,90,2000,true) ); // Nutrient Transport on sync mode
  ReefAngel.PWM.SetActinic( NutrientTransportMode(75,90,2000,false) ); // Nutrient Transport on anti-sync mode
}
else if (hour()>=17 && hour()<20)
{
  vtechmode=2;
  ReefAngel.PWM.SetDaylight( ReefCrestMode(80,20,true) ); // ReefCrest at 75% + - 20 on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(80,20,false) ); // ReefCrest at 75% + - 20 on anti-sync mode
}
else if (hour()>=20 && hour()<24)
{
  vtechmode=6;
  ReefAngel.PWM.SetDaylight( TidalSwellMode(60,true) ); // Tidal Swell at 60% on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(60,false) ); // Tidal Swell at 60% on anti-sync mode
}
else
{
  vtechmode=4;
  ReefAngel.PWM.SetDaylight( LongPulseMode(0,40,10,true) ); // Long pulse at 40% with 10s pulse on syncy mode
  ReefAngel.PWM.SetActinic( LongPulseMode(0,40,10,false) ); // Long pulse at 40% with 10s pulse on on anti-sync mode
}  

    ////// Place your custom code above here

    // This should always be the last line
    ReefAngel.ShowInterface();
}

//*********************************************************************************************************************************
//Custom Main, Graph & Menu
void DrawCustomMain()
{
  byte x = 6;
  byte y = 2;
  byte t;
  char text[7];

  ReefAngel.LCD.DrawDate(6, 2);
  ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
  pingSerial();

  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 90, "--------------------");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 6, 126, "--------------------");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 93, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 103, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 113, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 2, 123, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 93, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 103, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 113, "|");
  ReefAngel.LCD.DrawText(COLOR_TOMATO,255, 126, 123, "|");


  ReefAngel.LCD.DrawText(0,255,18,12,"Jebao Mode:");
  if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,22,"Constant");
  else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,42,21,"Lagoon");
  else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,21,"Reef Crest");
  else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,22,21,"Short Pulse");
  else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,21,"Long Pulse");
  else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,8,21,"Nutrient Trnsp.");
  else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,23,21,"Tidal Swell");
  else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,0,45,21,"Night");

  ReefAngel.LCD.DrawText(0,255,10,30,"Display");
  ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(COLOR_INDIANRED, 255, 10, 40, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,100,30,"pH");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_PLUM, 255, 85, 40, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,43,48,"Salinity");
  ConvertNumToString(text, ReefAngel.Params.Salinity, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN, 255, 49, 58, text, Num8x8);
  pingSerial();

  pingSerial();
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 77, TempRelay);

  ReefAngel.LCD.DrawText(0,255,8,68,"Sump");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T3_PROBE], COLOR_CORNFLOWERBLUE, 40, 68, 10);

  ReefAngel.LCD.DrawText(0,255,70,68,"Room");
  ReefAngel.LCD.DrawSingleMonitor(ReefAngel.Params.Temp[T2_PROBE], COLOR_CORNFLOWERBLUE, 99, 68, 10);

  ReefAngel.LCD.DrawText(0,255,8,97,"Moon");
  ReefAngel.LCD.DrawText(COLOR_CORNFLOWERBLUE,255,35,97,MoonPhaseLabel());
}
void DrawCustomGraph()
{
}
Roberto.
ReeferBee
Posts: 55
Joined: Wed May 08, 2013 6:23 pm
Location: North GA

Re: Help with custom screen

Post by ReeferBee »

Thanks Roberto!
Barry

Current tank info: 150g mixed reef

"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
ReeferBee
Posts: 55
Joined: Wed May 08, 2013 6:23 pm
Location: North GA

Re: Help with custom screen

Post by ReeferBee »

I'm having issues with using the DrawHugeText command for my sump temperature display. Part of the temp display is cut off. I've tried everything to fix it, no matter where I position it on the main screen its still cut off. If I need to post a pic of the screen I will.

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

byte vtechmode=0;

////// Place global variable code above here


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    ReefAngel.AddStandardMenu();  // Add Standard Menu

    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port5Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port5Bit | Port7Bit | Port8Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port1Bit | Port2Bit;
    // 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( 820 );


    // Ports that are always on
    ReefAngel.Relay.On( Port5 );
    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,13,0,0,0 );
    ReefAngel.StandardLights( Port2,12,30,0,30 );
    ReefAngel.DosingPumpRepeat( Port3,0,120,60 );
    ReefAngel.DosingPumpRepeat( Port4,29,120,60 );
    ReefAngel.StandardHeater( Port6,780,792 );
    ////// Place your custom code below here
    if (hour()>=8 && hour()<12)
{
  vtechmode=6;
  ReefAngel.PWM.SetDaylight( TidalSwellMode(60,true) ); // Tidal Swell at 60% on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(60,false) ); // Tidal Swell at 60% on anti-sync mode
}
else if (hour()>=12 && hour()<16)
{
  vtechmode=2;
  ReefAngel.PWM.SetDaylight( ReefCrestMode(80,20,true) ); // ReefCrest at 80% + - 20 on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(80,20,false) ); // ReefCrest at 80% + - 20 on anti-sync mode
}
else if (hour()>=16 && hour()<17)
{
  vtechmode=5;
  ReefAngel.PWM.SetDaylight( NutrientTransportMode(75,90,2000,true) ); // Nutrient Transport on sync mode
  ReefAngel.PWM.SetActinic( NutrientTransportMode(75,90,2000,false) ); // Nutrient Transport on anti-sync mode
}
else if (hour()>=17 && hour()<20)
{
  vtechmode=2;
  ReefAngel.PWM.SetDaylight( ReefCrestMode(80,20,true) ); // ReefCrest at 75% + - 20 on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(80,20,false) ); // ReefCrest at 75% + - 20 on anti-sync mode
}
else if (hour()>=20 && hour()<24)
{
  vtechmode=6;
  ReefAngel.PWM.SetDaylight( TidalSwellMode(60,true) ); // Tidal Swell at 60% on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(60,false) ); // Tidal Swell at 60% on anti-sync mode
}
else
{
  vtechmode=4;
  ReefAngel.PWM.SetDaylight( LongPulseMode(0,40,10,true) ); // Long pulse at 40% with 10s pulse on syncy mode
  ReefAngel.PWM.SetActinic( LongPulseMode(0,40,10,false) ); // Long pulse at 40% with 10s pulse on on anti-sync mode
} 

    ////// Place your custom code above here

    // This should always be the last line
    ReefAngel.ShowInterface();
}

//*********************************************************************************************************************************
//Custom Main, Graph & Menu
void DrawCustomMain()
{
  byte x = 6;
  byte y = 2;
  byte t;
  char text[7];

  ReefAngel.LCD.DrawDate(6, 3);
  ReefAngel.LCD.Clear(COLOR_BLACK, 1, 11, 132, 11);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,18,16,"   WP40 Mode:");
  if (vtechmode == 0) ReefAngel.LCD.DrawLargeText(COLOR_LIMEGREEN,255,35,27,"Constant");
  else if(vtechmode == 1) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,42,27,"Lagoon");
  else if (vtechmode == 2) ReefAngel.LCD.DrawLargeText(COLOR_GOLD,255,25,27,"Reef Crest");
  else if (vtechmode == 3) ReefAngel.LCD.DrawLargeText(COLOR_CORNFLOWERBLUE,255,22,27,"Short Pulse");
  else if (vtechmode == 4) ReefAngel.LCD.DrawLargeText(COLOR_PINK,255,25,27,"Long Pulse");
  else if (vtechmode == 5) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,8,27,"Nutrient Trnsp.");
  else if (vtechmode == 6) ReefAngel.LCD.DrawLargeText(COLOR_MAGENTA,255,23,27,"Tidal Swell");
  else if (vtechmode == 9) ReefAngel.LCD.DrawLargeText(COLOR_WHITE,255,45,27,"Night");

  ReefAngel.LCD.DrawText(0,255,15,40,"Sump");
  ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawHugeText(COLOR_RED, 255, 25, 60, text, Num8x8);
  pingSerial();

  ReefAngel.LCD.DrawText(0,255,100,40,"pH");
  ConvertNumToString(text, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(COLOR_PLUM, 255, 85, 60, text, Num8x8);
  pingSerial();

  pingSerial();
  byte TempRelay = ReefAngel.Relay.RelayData;
  TempRelay &= ReefAngel.Relay.RelayMaskOff;
  TempRelay |= ReefAngel.Relay.RelayMaskOn;
  ReefAngel.LCD.DrawOutletBox(12, 100, TempRelay);
  
}
void DrawCustomGraph()
{
}
Barry

Current tank info: 150g mixed reef

"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
ReeferBee
Posts: 55
Joined: Wed May 08, 2013 6:23 pm
Location: North GA

Re: Help with custom screen

Post by ReeferBee »

I figured it out!
Barry

Current tank info: 150g mixed reef

"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
User avatar
cosmith71
Posts: 1437
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: Help with custom screen

Post by cosmith71 »

What was it?
ReeferBee
Posts: 55
Joined: Wed May 08, 2013 6:23 pm
Location: North GA

Re: Help with custom screen

Post by ReeferBee »

Well, I thought I figured it out :)

I changed Num8x8 here:

Code: Select all

  ReefAngel.LCD.DrawText(0,255,15,40,"Sump");
  ConvertNumToString(text, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawHugeText(COLOR_RED, 255, 25, 60, text, Num8x8);
To Num12x16

But now it's not showing the full temp reading. It says 9.69???
Any ideas?
Barry

Current tank info: 150g mixed reef

"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
ReeferBee
Posts: 55
Joined: Wed May 08, 2013 6:23 pm
Location: North GA

Re: Help with custom screen

Post by ReeferBee »

I found my error once again. I changed the 10 after [T1_PROBE] to a 100, not knowing what the value was for. Now its back at 10 and everything looks great!
Barry

Current tank info: 150g mixed reef

"Some of the worst mistakes of my life were hair cuts" -Jim Morrison
Post Reply