new version issue

Related to the development libraries, released by Curt Binder
Post Reply
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

new version issue

Post by jjdezek »

I downloaded the latest version and redid my wizard and coding for my RA went into the portal to do the wp40 set up and no matter what i do it stay at 20 on both. whats up with that?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: new version issue

Post by rimai »

Can you post your code?
Roberto.
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: new version issue

Post by jjdezek »

I had to put the codes back in the custom area to get it to work. I was told with the new version you could toggle between wave modes in the portal. is this possible now?

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>

////// Place global variable code below here
#define NUMBERS_8x16
void DrawCustomMain()
{
// the graph is drawn/updated when we exit the main menu &
// when the parameters are saved
ReefAngel.LCD.DrawDate(6, 112);
ReefAngel.LCD.DrawText(COLOR_INDIGO, COLOR_WHITE,25,5, "Jeremy's Reef");
pingSerial();

DrawStatus (20,80);
DrawParams (5,40);
DrawParamsa (0,10);
pingSerial();
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 93, TempRelay);
}

////// 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 = Port5Bit | Port6Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port3Bit | Port7Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 800 );


    // 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.StandardATO( Port1,60 );
    ReefAngel.StandardLights( Port3,18,0,10,0 );
    ReefAngel.WavemakerRandom( Port5,30,100 );
    ReefAngel.WavemakerRandom( Port6,30,100 );
    ReefAngel.StandardHeater( Port7,752,755 );
    ////// Place your custom code below here
     if (hour()>=8 && hour()<12)
{
  ReefAngel.PWM.SetDaylight( ReefCrestMode(100,20,true) ); // ReefCrest at 100% +/- 20% on sync mode
  ReefAngel.PWM.SetActinic( ReefCrestMode(100,20,false) ); // ReefCrest at 100% +/- 20% on anti-sync mode
}
else if (hour()>=12 && hour()<18)
{
  ReefAngel.PWM.SetDaylight( ShortPulseMode(0,100,200,true) ); // Short pulse at 100% with 200ms pulse on sync mode
  ReefAngel.PWM.SetActinic( ShortPulseMode(0,100,200,false) ); // Short pulse at 100% with 200ms pulse on anti-sync mode
}
else
{
  ReefAngel.PWM.SetDaylight( LongPulseMode(0,100,10,true) ); // Long pulse at 100% with 10s pulse on sync mode
  ReefAngel.PWM.SetActinic( LongPulseMode(0,100,10,false) ); // Long pulse at 6100% with 10s pulse on anti-sync mode
}
if( ReefAngel.DisplayedMenu==FEEDING_MODE )
{
   ReefAngel.PWM.SetActinic(0);
   ReefAngel.PWM.SetDaylight(0);
}

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

    // This should always be the last line
    ReefAngel.Portal( "jjdezek" );
    ReefAngel.ShowInterface();
}
void DrawParamsa(int x, int y){
char buf[16];
  ReefAngel.LCD.DrawText(DPColor,DefaultBGColor,x+40,y+10,"WP40L:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(), DPColor, x+78, y+10,1);
ReefAngel.LCD.DrawText(APColor,DefaultBGColor,x+40,y+20,"WP40R:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),APColor, x+78, y+20,1);

}

void DrawParams(int x, int y) {
  char buf[16];

  ReefAngel.LCD.DrawText(COLOR_BLACK,DefaultBGColor,x+5,y,"Temp:");
  ReefAngel.LCD.DrawText(COLOR_BLACK,DefaultBGColor,x+80, y, "PH:");
  // Temp and PH
  y+=10;

  ConvertNumToString(buf, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(T1TempColor, DefaultBGColor, x+5, y, buf, Num8x16);
  ConvertNumToString(buf, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(PHColor, DefaultBGColor, x+80, y, buf, Num8x16);
  y+=5;

}

void DrawStatus(int x, int y) {
  int t=x;
  
  ReefAngel.LCD.DrawLargeText(COLOR_INDIGO,DefaultBGColor,15,y,"High",Font8x16);
  ReefAngel.LCD.DrawLargeText(COLOR_INDIGO,DefaultBGColor,85,y,"Low",Font8x16);
  
  if (ReefAngel.HighATO.IsActive()) {
    ReefAngel.LCD.FillCircle(55,y+3,5,COLOR_GREEN);
  } else {
    ReefAngel.LCD.FillCircle(55,y+3,5,COLOR_RED);
  }
  
  if (ReefAngel.LowATO.IsActive()) {
    ReefAngel.LCD.FillCircle(70,y+3,5,COLOR_GREEN);
  } else {
    ReefAngel.LCD.FillCircle(70,y+3,5,COLOR_RED);
  }
}


void DrawCustomGraph()
{
}
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: new version issue

Post by rimai »

Yes, but you need to generate a code with the wizard and make sure you check mark DC Pump on the attachment list.
Roberto.
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: new version issue

Post by jjdezek »

ok found it. thanks. i was looking under the dimming portion for a jeabo option. its earlier in the wizard.
Image
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: new version issue

Post by jjdezek »

what is the duration under the portal do?
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: new version issue

Post by rimai »

It's the length of the cycles for short and long pulse.
Roberto.
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: new version issue

Post by jjdezek »

Ok I set it up for reefcrest at 100% and duration of 9 and my power head is not working now
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: new version issue

Post by rimai »

Can you post the code?
Roberto.
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: new version issue

Post by jjdezek »

its running now but im not able to switch from one mode to another in the portal. it just stays in the reefcrest mode. also i set it at 100% yet it will go up to 120% on the display and in the portal. is it really running that high?

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>

////// Place global variable code below here
#define NUMBERS_8x16
void DrawCustomMain()
{
// the graph is drawn/updated when we exit the main menu &
// when the parameters are saved
ReefAngel.LCD.DrawDate(6, 112);
ReefAngel.LCD.DrawText(COLOR_INDIGO, COLOR_WHITE,25,5, "Jeremy's Reef");
pingSerial();

DrawStatus (20,80);
DrawParams (5,40);
DrawParamsa (0,10);
pingSerial();
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox(12, 93, TempRelay);
}

////// 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 = Port5Bit | Port6Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port3Bit | Port7Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 800 );

    // Feeeding and Water Change mode speed
    ReefAngel.DCPump.FeedingSpeed=0;
    ReefAngel.DCPump.WaterChangeSpeed=0;


    // 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.StandardATO( Port1,60 );
    ReefAngel.StandardLights( Port3,18,0,10,0 );
    ReefAngel.Wavemaker( Port5,60 );
    ReefAngel.Wavemaker( Port6,60 );
    ReefAngel.StandardHeater( Port7,751,761 );
    ReefAngel.DCPump.UseMemory = false;
    ReefAngel.DCPump.SetMode( ReefCrest,100,10 );
    ReefAngel.DCPump.DaylightChannel = AntiSync;
    ReefAngel.DCPump.ActinicChannel = Sync;
    ReefAngel.DCPump.ExpansionChannel[0] = None;
    ReefAngel.DCPump.ExpansionChannel[1] = None;
    ReefAngel.DCPump.ExpansionChannel[2] = None;
    ReefAngel.DCPump.ExpansionChannel[3] = None;
    ReefAngel.DCPump.ExpansionChannel[4] = None;
    ReefAngel.DCPump.ExpansionChannel[5] = None;
    ////// Place your custom code below here
    

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

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

void DrawParamsa(int x, int y){
char buf[16];
  ReefAngel.LCD.DrawText(DPColor,DefaultBGColor,x+40,y+10,"WP40L:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetDaylightValue(), DPColor, x+78, y+10,1);
ReefAngel.LCD.DrawText(APColor,DefaultBGColor,x+40,y+20,"WP40R:");
ReefAngel.LCD.DrawSingleMonitor(ReefAngel.PWM.GetActinicValue(),APColor, x+78, y+20,1);

}

void DrawParams(int x, int y) {
  char buf[16];

  ReefAngel.LCD.DrawText(COLOR_BLACK,DefaultBGColor,x+5,y,"Temp:");
  ReefAngel.LCD.DrawText(COLOR_BLACK,DefaultBGColor,x+80, y, "PH:");
  // Temp and PH
  y+=10;

  ConvertNumToString(buf, ReefAngel.Params.Temp[T1_PROBE], 10);
  ReefAngel.LCD.DrawLargeText(T1TempColor, DefaultBGColor, x+5, y, buf, Num8x16);
  ConvertNumToString(buf, ReefAngel.Params.PH, 100);
  ReefAngel.LCD.DrawLargeText(PHColor, DefaultBGColor, x+80, y, buf, Num8x16);
  y+=5;

}

void DrawStatus(int x, int y) {
  int t=x;
  
  ReefAngel.LCD.DrawLargeText(COLOR_INDIGO,DefaultBGColor,15,y,"High",Font8x16);
  ReefAngel.LCD.DrawLargeText(COLOR_INDIGO,DefaultBGColor,85,y,"Low",Font8x16);
  
  if (ReefAngel.HighATO.IsActive()) {
    ReefAngel.LCD.FillCircle(55,y+3,5,COLOR_GREEN);
  } else {
    ReefAngel.LCD.FillCircle(55,y+3,5,COLOR_RED);
  }
  
  if (ReefAngel.LowATO.IsActive()) {
    ReefAngel.LCD.FillCircle(70,y+3,5,COLOR_GREEN);
  } else {
    ReefAngel.LCD.FillCircle(70,y+3,5,COLOR_RED);
  }
}

void DrawCustomGraph()
{
}
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: new version issue

Post by lnevo »

Your code is hard coding the mode and is disabling memory.

Take out those two lines...the one saying UseMemory=false; and the one after setting it to ReefCrestMode.
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: new version issue

Post by jjdezek »

ok deleted the usememory=false but cant find the other one.
Image
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: new version issue

Post by jjdezek »

are you talking about this part of the code?

ReefAngel.DCPump.SetMode( ReefCrest,100,10 );
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: new version issue

Post by lnevo »

Yes.
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: new version issue

Post by jjdezek »

ok done but it still seems like its not working correctly. i can switch it between reefcrest and tidal swell but cant get it to take nutrient export or a few others. its like sometimes it works and other times it wont.
Image
jjdezek
Posts: 329
Joined: Fri May 17, 2013 1:35 pm

Re: new version issue

Post by jjdezek »

It works from my phone computer is to slow to work I guess
Image
Poiromaniax
Posts: 180
Joined: Thu Apr 05, 2012 6:20 am
Location: JHB, South Africa

Re: new version issue

Post by Poiromaniax »

just on the duration note - will the duration affect Vortech pump modes as well? Say if i want to run the default Vortech ReefCrest mode, do i make duration 0 or leave it as 10?
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: new version issue

Post by lnevo »

Duration is not used by reefcrest
Poiromaniax
Posts: 180
Joined: Thu Apr 05, 2012 6:20 am
Location: JHB, South Africa

Re: new version issue

Post by Poiromaniax »

Thanks!
Image
Post Reply