New DCPump Modes - How to code???

Do you have a question on how to do something.
Ask in here.
User avatar
cosmith71
Posts: 1432
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: New DCPump Modes - How to code???

Post by cosmith71 »

You could also use ShortPulse mode. It's like LongPulse but with duration in ms.

--Colin
davaraj
Posts: 98
Joined: Sun Jul 21, 2013 8:18 am

Re: New DCPump Modes - How to code???

Post by davaraj »

lnevo wrote:
ReefAngel.DCPump.SetMode(TidalSwell 55); and
ReefAngel.DCPump.SetMode(millis();1200>750?50:0);
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.

Try this:

ReefAngel.DCPump.SetMode(TidalSwell,55,0);

ReefAngel.DCPump.SetMode(Constant,millis();1200>750?50:0,0);
Lee,

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
Image
davaraj
Posts: 98
Joined: Sun Jul 21, 2013 8:18 am

Re: New DCPump Modes - How to code???

Post by davaraj »

lnevo wrote:
ReefAngel.DCPump.SetMode(TidalSwell 55); and
ReefAngel.DCPump.SetMode(millis();1200>750?50:0);
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.

Try this:

ReefAngel.DCPump.SetMode(TidalSwell,55,0);

ReefAngel.DCPump.SetMode(Constant,millis();1200>750?50:0,0);
Lee,

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.
Image
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: New DCPump Modes - How to code???

Post by lnevo »

Should be millis()% i copied and pasted and didnt notice the mistake. Good catch
davaraj
Posts: 98
Joined: Sun Jul 21, 2013 8:18 am

Re: New DCPump Modes - How to code???

Post by davaraj »

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
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: New DCPump Modes - How to code???

Post by rimai »

Are you using memory settings set to true or false?
Roberto.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: New DCPump Modes - How to code???

Post by lnevo »

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.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: New DCPump Modes - How to code???

Post by lnevo »

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;
}
User avatar
cosmith71
Posts: 1432
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: New DCPump Modes - How to code???

Post by cosmith71 »

That's not really how it's intended to work. The range should be speed plus or minus offset.
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: New DCPump Modes - How to code???

Post by lnevo »

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.
davaraj
Posts: 98
Joined: Sun Jul 21, 2013 8:18 am

Re: New DCPump Modes - How to code???

Post by davaraj »

rimai wrote:Are you using memory settings set to true or false?
ReefAngel.DCPump.UseMemory=false;
Image
User avatar
cosmith71
Posts: 1432
Joined: Fri Mar 29, 2013 3:51 pm
Location: Oklahoma City

Re: New DCPump Modes - How to code???

Post by cosmith71 »

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.
I've got a fix for it. I'll submit it shortly.

--Colin
Smotz
Posts: 401
Joined: Sat Mar 30, 2013 5:02 pm
Location: CT, USA

Re: New DCPump Modes - How to code???

Post by Smotz »

Anyone have any follow up on this? I am having this same problem.
Post Reply