New DCPump Modes - How to code???
Re: New DCPump Modes - How to code???
I uncommented the GyreModes and uploaded your code to one of my RA+ units. I manually changed the time to 1400 and 1900 and it worked both times.
The only thing I can recommend is doing an un-install/re-install of the the RA software on your computer. Maybe you have a corrupted library.
--Colin
The only thing I can recommend is doing an un-install/re-install of the the RA software on your computer. Maybe you have a corrupted library.
--Colin
Re: New DCPump Modes - How to code???
The only potential problem I see is that between 1400 and 1500 you have both pumps set to sync. That means they will both be on for 10 minutes and off for 10 minutes at the same time.
--Colin
--Colin
-
- Posts: 127
- Joined: Thu Sep 19, 2013 7:46 am
- Location: Saint Cloud, FL
Re: New DCPump Modes - How to code???
Ok I will change sync
Will try to do a clean install
Will try to do a clean install
-
- Posts: 127
- Joined: Thu Sep 19, 2013 7:46 am
- Location: Saint Cloud, FL
Re: New DCPump Modes - How to code???
Reinstall did not work?
Is there something in the registry to delete?
Is there something in the registry to delete?
Re: New DCPump Modes - How to code???
Upload this code and see what you get:
It worked for me.
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 <PAR.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
ReefAngel.Use2014Screen(); // Let's use 2014 Screen
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 0;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Ports that are always on
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
////// Place your custom code below here
ReefAngel.PWM.SetDaylight (GyreMode(40,100,10,true) ); // Short pulse at 60% with 200m
ReefAngel.PWM.SetActinic(GyreMode(40,100,10,false) ); // Short pulse at 60% with 200ms pulse on anti-sync mode
////// Place your custom code above here
// This should always be the last line
ReefAngel.ShowInterface();
}
Roberto.
-
- Posts: 127
- Joined: Thu Sep 19, 2013 7:46 am
- Location: Saint Cloud, FL
Re: New DCPump Modes - How to code???
To Close this out:
Uninstalled and resinstalled Arduino application, did this twice. Then reinstalled once again last night and it worked?? No idea why it just worked.
Uninstalled and resinstalled Arduino application, did this twice. Then reinstalled once again last night and it worked?? No idea why it just worked.
Re: New DCPump Modes - How to code???
Are these DCPump codes meant for a single pump? How do I code for 2 pumps connected to the Actinic and DayLight channels?cosmith71 wrote:They're easy if you're using the DCPump libraries already.
Generates a random flow from midpoint-offset to midpoint+offset. For example, if you use:Code: Select all
ReefAngel.DCPump.SetMode(Else,midpoint,offset);
You'll get a random flow that ranges between 30 and 70.Code: Select all
ReefAngel.DCPump.SetMode(Else,50,20);
Generates a long, slow sine wave. Speed is the max speed, duration (in minutes), and threshold is the minimum speed. If you leave off threshold it will use 30 (or whatever you have set with DCPump.Threshold).Code: Select all
ReefAngel.DCPump.SetMode(Gyre,speed,duration,threshold);
I'm not familiar with Sine. Maybe someone else can chime in.
--Colin
Dr Davaraj
Re: New DCPump Modes - How to code???
You will have lines like this in the setup section of your code
ReefAngel.DCPump.ActinicChannel = Sync;
ReefAngel.DCPump.DaylightChannel = AntiSync;
If you want to disable one channel you can set it to None.
If you want both pumps to do the same thing then set them both to Sync.
ReefAngel.DCPump.ActinicChannel = Sync;
ReefAngel.DCPump.DaylightChannel = AntiSync;
If you want to disable one channel you can set it to None.
If you want both pumps to do the same thing then set them both to Sync.
Re: New DCPump Modes - How to code???
I have recoded like this. I do havelnevo wrote:You will have lines like this in the setup section of your code
ReefAngel.DCPump.ActinicChannel = Sync;
ReefAngel.DCPump.DaylightChannel = AntiSync;
If you want to disable one channel you can set it to None.
If you want both pumps to do the same thing then set them both to Sync.
ReefAngel.DCPump.ActinicChannel = Sync
ReefAngel.DCPump.DaylightChannel = AntiSync
In the setup section.
///////Place your custom code below here
if (hour()>=4 && hour()<8)
{
ReefAngel.DCPump.SetMode(Sine, 30, 40);
}
else if (hour()>=8 && hour()<12)
{
ReefAngel.DCPump.SetMode(TidalSwell, 55); // TidalSwell at 55%
}
else if (hour()>=12 && hour()<16)
{
ReefAngel.DCPump.SetMode(millis();1200>750?50:0);
}
else if (hour()>=16 && hour()<19)
{
ReefAngel.DCPump.SetMode(LongPulse, 0, 50, 10); // Long pulse at 0% to 50% with 10s pulse
}
else if (hour()>=19 && hour()<23)
{
ReefAngel.DCPump.SetMode(Else, 40, 10); // ElseMode 40 +/- 10%
}
else
{
ReefAngel.DCPump.SetMode(Gyre, 30, 50, 10); //GyreMode from 30% to 50% for 10 minutes
}
////// Place your custom code above here
When I run 'verify' code it compiles, except for:
ReefAngel.DCPump.SetMode(TidalSwell, 55); and
ReefAngel.DCPump.SetMode(millis();1200>750?50:0);
When I insert this:
ReefAngel.DCPump.SetMode(TidalSwell, 55, true); it compiles for this mode. However 'millis' gives errors. How do I code for millis (standing wave like W1 in Jebao controller)?
Re: New DCPump Modes - How to code???
You need 3 arguments to SetMode separated by a comma. Mode Speed and Duration. The first only has 2 and no comma and the second, that code block represents one argument and it represents a speed.ReefAngel.DCPump.SetMode(TidalSwell 55); and
ReefAngel.DCPump.SetMode(millis();1200>750?50:0);
Try this:
ReefAngel.DCPump.SetMode(TidalSwell,55,0);
ReefAngel.DCPump.SetMode(Constant,millis();1200>750?50:0,0);
Re: New DCPump Modes - How to code???
You could also use ShortPulse mode. It's like LongPulse but with duration in ms.
--Colin
--Colin
Re: New DCPump Modes - How to code???
Lee,lnevo wrote:You need 3 arguments to SetMode separated by a comma. Mode Speed and Duration. The first only has 2 and no comma and the second, that code block represents one argument and it represents a speed.ReefAngel.DCPump.SetMode(TidalSwell 55); and
ReefAngel.DCPump.SetMode(millis();1200>750?50:0);
Try this:
ReefAngel.DCPump.SetMode(TidalSwell,55,0);
ReefAngel.DCPump.SetMode(Constant,millis();1200>750?50:0,0);
I realised I had missed the comma in all the wave settings when I posted this on the forum. In my laptop the commas are there. I'll insert codes for TidalSwell and millis and let you know how it compiles and runs the pumps.
Thank you very much.
Dr Davaraj
Re: New DCPump Modes - How to code???
Lee,lnevo wrote:You need 3 arguments to SetMode separated by a comma. Mode Speed and Duration. The first only has 2 and no comma and the second, that code block represents one argument and it represents a speed.ReefAngel.DCPump.SetMode(TidalSwell 55); and
ReefAngel.DCPump.SetMode(millis();1200>750?50:0);
Try this:
ReefAngel.DCPump.SetMode(TidalSwell,55,0);
ReefAngel.DCPump.SetMode(Constant,millis();1200>750?50:0,0);
ReefAngel.DCPump.SetMode(Constant,millis();1200>750?50:0,0); gives error, but
ReefAngel.DCPump.SetMode(Constant,millis()%1200>750?50:0,0); compiles without error.
Re: New DCPump Modes - How to code???
Should be millis()% i copied and pasted and didnt notice the mistake. Good catch
Re: New DCPump Modes - How to code???
I have this code set for Else mode.
ReefAngel.DCPump.SetMode(Else,50,20);
So the pump should ramp up and down from 30% to 70%, randomly. However, mine goes from 30% to 90% . Is there something wrong with the code or is that how the pump will work?
Dr Davaraj
ReefAngel.DCPump.SetMode(Else,50,20);
So the pump should ramp up and down from 30% to 70%, randomly. However, mine goes from 30% to 90% . Is there something wrong with the code or is that how the pump will work?
Dr Davaraj
Re: New DCPump Modes - How to code???
The DCPump defaults for ElseMode is going to be equal to the speed. So for 50 it will be 50. For anything greater than 50, the speed will be 100-speed.
Re: New DCPump Modes - How to code???
case Else:
{
int offset = DCPump.Speed;
if (DCPump.Speed > 50) offset = 100 - DCPump.Speed;
SyncSpeed=ElseMode(DCPump.Speed,offset,true);
AntiSyncSpeed=ElseMode(DCPump.Speed,offset,false);
break;
}
Re: New DCPump Modes - How to code???
That's not really how it's intended to work. The range should be speed plus or minus offset.
Re: New DCPump Modes - How to code???
AlanM added ElseMode to the libraries. And yes, I agree with you Colin. What do you think would be a good defaults for ElseMode in the libraries? We can easily modify this.
Re: New DCPump Modes - How to code???
ReefAngel.DCPump.UseMemory=false;rimai wrote:Are you using memory settings set to true or false?
Re: New DCPump Modes - How to code???
I've got a fix for it. I'll submit it shortly.lnevo wrote:AlanM added ElseMode to the libraries. And yes, I agree with you Colin. What do you think would be a good defaults for ElseMode in the libraries? We can easily modify this.
--Colin
Re: New DCPump Modes - How to code???
Anyone have any follow up on this? I am having this same problem.