Setting Nutrient Mode when in Feeding Mode.

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Setting Nutrient Mode when in Feeding Mode.

Post by Sacohen »

How would I code switching my WP-40 to Nutrient Mode when I hit the Feeding Mode on the menu, the Andriod App or the Web Portal?

This is what I currently have.

Code: Select all

ReefAngel.PWM.SetActinic(MyCustomWave(50));
if( ReefAngel.DisplayedMenu==FEEDING_MODE ) ReefAngel.PWM.SetActinic(0);
if( ReefAngel.DisplayedMenu==WATERCHANGE_MODE ) ReefAngel.PWM.SetActinic(0);
if (hour()<12 || hour()>=22) ReefAngel.PWM.SetActinic(30);
////// Place your custom code below here
Would it be...

Code: Select all

if( ReefAngel.DisplayedMenu==FEEDING_MODE ) ReefAngel.PWM.SetActinic( NutrientTransportMode(25,35,600,true));
Last edited by Sacohen on Wed Jun 19, 2013 4:50 pm, edited 1 time in total.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Setting Nutrient Mode when in Feeding Mode.

Post by Sacohen »

This does work.
I tried it when I got home. I need to tweak the speeds though.
markywmson
Posts: 51
Joined: Wed Feb 27, 2013 11:35 am

Re: Setting Nutrient Mode when in Feeding Mode.

Post by markywmson »

Remember with Nutrient Transport mode, I think I remember Roberto saying it takes ~1 1/2 hours to complete...
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Setting Nutrient Mode when in Feeding Mode.

Post by lnevo »

2.5

Most people run it *after* feeding mode.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Setting Nutrient Mode when in Feeding Mode.

Post by Sacohen »

Thanks.

So how would I code the Nutrient Transport to start when my 10 min Feeding Mode is over and then go back to my Custom Wave ~2 1/2 hours later when the Nutrient Transport is over?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Setting Nutrient Mode when in Feeding Mode.

Post by lnevo »

This is how I did it for PaulTurner911

Code: Select all

   static unsigned long feeding;
  if (ReefAngel.DisplayedMenu==FEEDING_MODE)
    feeding = now();
    ReefAngel.PWM.SetDaylight( 0 );
  } else if (now()-feeding<=3600) { // next 60 minutes will be in NTM
      ReefAngel.PWM.SetDaylight( NutrientTransportMode(min,max,duration*100,true) );
  } 
If you are using the new DCPump setup, you will need to set ReefAngel.DCPump.UseMemory=false;

And make sure this code happens AFTER any other settings you may have for the pump or it will get lost.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Setting Nutrient Mode when in Feeding Mode.

Post by Sacohen »

Thanks Lee;

What does the

Code: Select all

  static unsigned long feeding;
do?
It seems like something is missing before it like an ( or //
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Setting Nutrient Mode when in Feeding Mode.

Post by lnevo »

It is declaring the variable feeding which records the last time feeding mode was active. feeding is an unsigned long which is big enough to hold the number of seconds since 1970. Its static so the variable isn't reinitialized to 0 at the beginning of each loop(). Hope that helps.
Post Reply