Page 2 of 2

Re: jebo wp40

Posted: Mon Jun 10, 2013 9:31 pm
by rimai
Yes, there is a way...
It's your homework now to change the position of the stuff to your liking :)
It's all based on the x and y, which are coordinates of where you want to display stuff.
The top left corner is 0,0 and it goes to 132,132 at the bottom right corner.
Just go changing the coordinates for each stuff you want to move and play around until you get what you want :)

Re: jebo wp40

Posted: Mon Jun 10, 2013 9:37 pm
by 805reefer
ok that sounds good to me so it showing its in tidal swell mode but is should be in sine mode? so whats showing on the screen is what mode its in right

Re: jebo wp40

Posted: Mon Jun 10, 2013 9:38 pm
by 805reefer

Code: Select all

    ////// Place your custom code below here
    static time_t feeding;

// Time schedule first
if (hour()>=6 && hour()<11) {
  //ReefAngel.PWM.SetDaylight( TidalSwellMode(45,true) ); // TidalSwell at 45% on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(30,true) ); // TidalSwell at 30% on sync mode
  wpMode=1;
} else if (hour()>=11 && hour()<15) {
  //ReefAngel.PWM.SetDaylight( ReefCrestMode(70,20,true) ); // ReefCrest at 70% +/- 20% on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(40,20,true) ); // ReefCrest at 40% +/- 20% on anti-sync mode
  wpMode=2;
} else if ( (hour()>=15 && hour()<18) && (now()-feeding > SECS_PER_DAY) ) { // We haven't fed today
// ReefAngel.PWM.SetDaylight( NutrientTransportMode(30,60,6000,true) );
  ReefAngel.PWM.SetActinic( NutrientTransportMode(25,35,6000,true) );
  wpMode=3;
} else if (hour()>=15 && hour()<18) {
// ReefAngel.PWM.SetDaylight( ReefCrestMode(70,20,true) ); // ReefCrest at 70% +/- 20% on sync mode
   ReefAngel.PWM.SetActinic(ShortPulseMode(15,42,3000,true));
  wpMode=2;
} else if (hour()>=18 && hour()<20) {
// ReefAngel.PWM.SetDaylight( ReefCrestMode(70,20,true) ); // ReefCrest at 70% +/- 20% on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(32,20,true) ); // ReefCrest at 32% +/- 20% on anti-sync mode
  wpMode=2;
} else if (hour()>=20 && hour ()<23) {
// ReefAngel.PWM.SetDaylight(SineMode(20,40,30,true) ); //SineMode from 20% to 40% for 30 seconds on sync mode
  ReefAngel.PWM.SetActinic(SineMode(20,40,30,true) ); //SineMode from 20% to 40% for 30 seconds on sync mode
  wpMode=1;
} else {
  //ReefAngel.PWM.SetDaylight(SineMode(15,40,30,true) ); //SineMode from 15% to 40% for 30 seconds on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(20,true) ); // TidalSwell at 20% on sync mode
  wpMode=4; 
}  
  if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE) {
  //ReefAngel.PWM.SetDaylight(0); 
  ReefAngel.PWM.SetActinic(0);   
}    

// If we are feeding override the schedule
if (ReefAngel.DisplayedMenu==FEEDING_MODE) {
// ReefAngel.PWM.SetDaylight(30); 
  ReefAngel.PWM.SetActinic(0); 
  wpMode=0;
  feeding=now();  

Re: jebo wp40

Posted: Mon Jun 10, 2013 9:42 pm
by rimai
I think you got it inverted....
Look at your code that displays the modes:

Code: Select all

  if (wpMode == 0) ReefAngel.LCD.DrawText(COLOR_GREEN,255,x,y,"Feeding");
  else if (wpMode == 1) ReefAngel.LCD.DrawText(COLOR_MAGENTA,255,x,y,"Tidal Swell");
  else if (wpMode == 2) ReefAngel.LCD.DrawText(COLOR_GOLD,255,x,y,"Reef Crest");
  else if (wpMode == 3) ReefAngel.LCD.DrawText(COLOR_RED,255,x,y,"Nutrient");
  else if (wpMode == 4) ReefAngel.LCD.DrawText(COLOR_BLUE,255,x,y,"Sine Wave");
And look at what you are assigning to wpMode here:

Code: Select all

} else if (hour()>=20 && hour ()<23) {
// ReefAngel.PWM.SetDaylight(SineMode(20,40,30,true) ); //SineMode from 20% to 40% for 30 seconds on sync mode
  ReefAngel.PWM.SetActinic(SineMode(20,40,30,true) ); //SineMode from 20% to 40% for 30 seconds on sync mode
  wpMode=1;
} else {
  //ReefAngel.PWM.SetDaylight(SineMode(15,40,30,true) ); //SineMode from 15% to 40% for 30 seconds on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(20,true) ); // TidalSwell at 20% on sync mode
  wpMode=4; 
}  
Can you see that they are inverted?

Re: jebo wp40

Posted: Mon Jun 10, 2013 9:47 pm
by 805reefer
oh got you so thats because i changed some of the modes around right?

Re: jebo wp40

Posted: Tue Jun 11, 2013 3:50 am
by lnevo
Exactly

Re: jebo wp40

Posted: Tue Jun 11, 2013 10:22 am
by binder
my tutorial on custom main screens covers the x,y coordinates of the screen. if you get confused, read that tutorial and it should help.

Re: jebo wp40

Posted: Tue Jun 11, 2013 3:35 pm
by 805reefer
Ok will do I'm going to start working on it in about an hour I really appreciate all the help

Re: jebo wp40

Posted: Tue Jun 11, 2013 7:15 pm
by 805reefer
ok thanks to binder and his tutorial i got my screen to show the whole mode now and not only half... now another issue so i put it in feeding mode for the first time today and noticed that my pump didnt shut off which i have it set to 0 what do i need to do here

Code: Select all

    ////// Place your custom code below here
    static time_t feeding;

// Time schedule first
if (hour()>=6 && hour()<11) {
  //ReefAngel.PWM.SetDaylight( TidalSwellMode(45,true) ); // TidalSwell at 45% on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(30,true) ); // TidalSwell at 30% on sync mode
  wpMode=1;
} else if (hour()>=11 && hour()<15) {
  //ReefAngel.PWM.SetDaylight( ReefCrestMode(70,20,true) ); // ReefCrest at 70% +/- 20% on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(40,20,true) ); // ReefCrest at 40% +/- 20% on anti-sync mode
  wpMode=2;
} else if ( (hour()>=15 && hour()<18) && (now()-feeding > SECS_PER_DAY) ) { // We haven't fed today
// ReefAngel.PWM.SetDaylight( NutrientTransportMode(30,60,6000,true) );
  ReefAngel.PWM.SetActinic( NutrientTransportMode(25,35,6000,true) );
  wpMode=3;
} else if (hour()>=15 && hour()<18) {
// ReefAngel.PWM.SetDaylight( ReefCrestMode(70,20,true) ); // ReefCrest at 70% +/- 20% on sync mode
   ReefAngel.PWM.SetActinic(ShortPulseMode(15,42,3000,true));
  wpMode=5;
} else if (hour()>=18 && hour()<20) {
// ReefAngel.PWM.SetDaylight( ReefCrestMode(70,20,true) ); // ReefCrest at 70% +/- 20% on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(32,20,true) ); // ReefCrest at 32% +/- 20% on anti-sync mode
  wpMode=2;
} else if (hour()>=20 && hour ()<23) {
// ReefAngel.PWM.SetDaylight(SineMode(20,40,30,true) ); //SineMode from 20% to 40% for 30 seconds on sync mode
  ReefAngel.PWM.SetActinic(SineMode(20,40,30,true) ); //SineMode from 20% to 40% for 30 seconds on sync mode
  wpMode=4;
} else {
  //ReefAngel.PWM.SetDaylight(SineMode(15,40,30,true) ); //SineMode from 15% to 40% for 30 seconds on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(20,true) ); // TidalSwell at 20% on sync mode
  wpMode=1; 
}  
  if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE) {
  //ReefAngel.PWM.SetDaylight(0); 
  ReefAngel.PWM.SetActinic(0);   
}    

// If we are feeding override the schedule
if (ReefAngel.DisplayedMenu==FEEDING_MODE) {
// ReefAngel.PWM.SetDaylight(30); 
  ReefAngel.PWM.SetActinic(0); 
  wpMode=0;
  feeding=now();  
}
// If we have finished feeding, start NTM for 3 hours
if (now()-feeding < 3*SECS_PER_HOUR) {
//ReefAngel.PWM.SetDaylight( NutrientTransportMode(30,60,6000,true) );
  ReefAngel.PWM.SetActinic( NutrientTransportMode(25,40,6000,true) );
  wpMode=3;
}  
  if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE) {
  //ReefAngel.PWM.SetDaylight(0); 
  ReefAngel.PWM.SetActinic(0); 

Re: jebo wp40

Posted: Tue Jun 11, 2013 7:28 pm
by lnevo
Hmm well oddly you have the WaterChange mode code twice...which isn't the issue here, but it makes me wonder what we may not be seeing...can you post your whole code? I don't see any reason why it wouldn't set to 0. The code looks good...

Re: jebo wp40

Posted: Tue Jun 11, 2013 8:02 pm
by 805reefer
wow just saw that so i removed one of the water changes and still nothing heres the code

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
static byte wpMode;

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


void setup()
{
    // This must be the first line
    ReefAngel.Init();  //Initialize controller
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = 0;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port4Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = Port6Bit | Port7Bit;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port6Bit | Port7Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;


    // Ports that are always on
    ReefAngel.Relay.On( Port2 );
    ReefAngel.Relay.On( Port4 );
    ReefAngel.Relay.On( Port8 );

    ////// Place additional initialization code below here
    

    ////// Place additional initialization code above here
}

void loop()
{
    ReefAngel.StandardHeater( Port1 );
    ReefAngel.DosingPumpRepeat1( Port3 );
    ReefAngel.DosingPumpRepeat2( Port5 );
    ReefAngel.DayLights( Port6 );
    ReefAngel.ActinicLights( Port7 );
    ReefAngel.PWM.DaylightPWMSlope();
    ReefAngel.PWM.Channel0PWMSlope(40);
    ReefAngel.PWM.Channel1PWMSlope(10);
    ReefAngel.PWM.Channel2PWMSlope(20);
    ReefAngel.PWM.Channel3PWMSlope(35);
    ReefAngel.PWM.Channel4PWMSlope(25);
    ////// Place your custom code below here
    static time_t feeding;

// Time schedule first
if (hour()>=6 && hour()<9) {
  //ReefAngel.PWM.SetDaylight( TidalSwellMode(45,true) ); // TidalSwell at 45% on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(30,true) ); // TidalSwell at 30% on sync mode
  wpMode=1;
} else if (hour()>=9 && hour()<12) {
  //ReefAngel.PWM.SetDaylight( ReefCrestMode(70,20,true) ); // ReefCrest at 70% +/- 20% on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(40,20,true) ); // ReefCrest at 40% +/- 20% on anti-sync mode
  wpMode=2;
} else if ( (hour()>=12 && hour()<15) && (now()-feeding > SECS_PER_DAY) ) { // We haven't fed today
// ReefAngel.PWM.SetDaylight( NutrientTransportMode(30,60,6000,true) );
  ReefAngel.PWM.SetActinic( NutrientTransportMode(25,35,6000,true) );
  wpMode=3;
} else if (hour()>=15 && hour()<18) {
// ReefAngel.PWM.SetDaylight( ReefCrestMode(70,20,true) ); // ReefCrest at 70% +/- 20% on sync mode
   ReefAngel.PWM.SetActinic(ShortPulseMode(15,42,3000,true));
  wpMode=5;
} else if (hour()>=18 && hour()<20) {
// ReefAngel.PWM.SetDaylight( ReefCrestMode(70,20,true) ); // ReefCrest at 70% +/- 20% on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(40,20,true) ); // ReefCrest at 40% +/- 20% on anti-sync mode
  wpMode=2;
} else if (hour()>=20 && hour ()<23) {
// ReefAngel.PWM.SetDaylight(SineMode(20,40,30,true) ); //SineMode from 20% to 40% for 30 seconds on sync mode
  ReefAngel.PWM.SetActinic(SineMode(20,40,30,true) ); //SineMode from 20% to 40% for 30 seconds on sync mode
  wpMode=4;
} else {
  //ReefAngel.PWM.SetDaylight(SineMode(15,40,30,true) ); //SineMode from 15% to 40% for 30 seconds on sync mode
  ReefAngel.PWM.SetActinic( TidalSwellMode(20,true) ); // TidalSwell at 20% on sync mode
  wpMode=1; 

}    

// If we are feeding override the schedule
if (ReefAngel.DisplayedMenu==FEEDING_MODE) {
// ReefAngel.PWM.SetDaylight(30); 
  ReefAngel.PWM.SetActinic (0);
  wpMode=0;
  feeding=now();  
}
// If we have finished feeding, start NTM for 3 hours
if (now()-feeding < 3*SECS_PER_HOUR) {
//ReefAngel.PWM.SetDaylight( NutrientTransportMode(30,60,6000,true) );
  ReefAngel.PWM.SetActinic( NutrientTransportMode(25,40,6000,true) );
  wpMode=3;
}  
  if (ReefAngel.DisplayedMenu==WATERCHANGE_MODE) {
  //ReefAngel.PWM.SetDaylight(0); 
  ReefAngel.PWM.SetActinic(0); 
  }
    ////// Place your custom code above here

    // This should always be the last line
    ReefAngel.Portal( "805reefer" );
    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();
  // WP40 Mode
x = 15;
y = 33;
  ReefAngel.LCD.DrawText(0,255,x,y,"RF:"); 
  ReefAngel.LCD.Clear(DefaultBGColor,x,y,128-x,y+8);
  if (wpMode == 0) ReefAngel.LCD.DrawText(COLOR_GREEN,255,x,y,"Feeding");
  else if (wpMode == 1) ReefAngel.LCD.DrawText(COLOR_MAGENTA,255,x,y,"Tidal Swell");
  else if (wpMode == 2) ReefAngel.LCD.DrawText(COLOR_GOLD,255,x,y,"Reef Crest");
  else if (wpMode == 3) ReefAngel.LCD.DrawText(COLOR_RED,255,x,y,"Nutrient");
  else if (wpMode == 4) ReefAngel.LCD.DrawText(COLOR_BLUE,255,x,y,"Sine Wave");
  else if (wpMode == 5) ReefAngel.LCD.DrawText(COLOR_GREEN,255,x,y,"Short Pulse");
    // Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 43, ReefAngel.Params,
    ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
    ReefAngel.LCD.DrawMonitor( 15, 43, 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, 84, TempRelay );
    pingSerial();

    // Date and Time
    ReefAngel.LCD.DrawDate( 6, 122 );
    pingSerial();
}

void DrawCustomGraph()
{
}

Re: jebo wp40

Posted: Tue Jun 11, 2013 8:40 pm
by 805reefer
when i push water change the pump does turn off..... as far as the wave patterns they all work each time the mode changes the flow is changing... what are you seeing

Re: jebo wp40

Posted: Tue Jun 11, 2013 8:50 pm
by 805reefer
ya im tying to learn but im just having so many different problems trying to figure this stuff out im glad we have some pros on here thats for sure

Re: jebo wp40

Posted: Tue Jun 11, 2013 10:43 pm
by lnevo
I see what the problem is. Move the feeding_mode section below the nutrient transport mode section. That is overriding the feeding mode. My bad on that one.

Re: jebo wp40

Posted: Wed Jun 12, 2013 8:43 pm
by 805reefer
ok cool that fixed it i really appreciate all you help and time you spent with me on this thanks again im sure there will be more to come :mrgreen:

Re: jebo wp40

Posted: Fri Jun 14, 2013 10:11 am
by Smotz
Any way this can get displayed on my tablet via the app?

Re: jebo wp40

Posted: Fri Jun 14, 2013 10:20 am
by rimai
If everything goes well, yes.
I'm working on a libraries update and creating a new class for these dc pumps.
They will have new XML tags for mode, speed and duration, which apps and the portal will be able to leverage and utilize it to display in the user interface.

Re: jebo wp40

Posted: Fri Jun 14, 2013 10:25 am
by Smotz
rimai wrote:If everything goes well, yes.
I'm working on a libraries update and creating a new class for these dc pumps.
They will have new XML tags for mode, speed and duration, which apps and the portal will be able to leverage and utilize it to display in the user interface.
Thats awesome.

Re: jebo wp40

Posted: Fri Jun 14, 2013 12:08 pm
by bhazard
rimai wrote:If everything goes well, yes.
I'm working on a libraries update and creating a new class for these dc pumps.
They will have new XML tags for mode, speed and duration, which apps and the portal will be able to leverage and utilize it to display in the user interface.
Awesome! Loving the Reef Angel. Support is top notch.

Re: jebo wp40

Posted: Fri Jun 14, 2013 7:05 pm
by rimai