Page 1 of 1

Setting Nutrient Mode when in Feeding Mode.

Posted: Wed Jun 19, 2013 10:42 am
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));

Re: Setting Nutrient Mode when in Feeding Mode.

Posted: Wed Jun 19, 2013 4:03 pm
by Sacohen
This does work.
I tried it when I got home. I need to tweak the speeds though.

Re: Setting Nutrient Mode when in Feeding Mode.

Posted: Wed Jun 19, 2013 8:46 pm
by markywmson
Remember with Nutrient Transport mode, I think I remember Roberto saying it takes ~1 1/2 hours to complete...

Re: Setting Nutrient Mode when in Feeding Mode.

Posted: Thu Jun 20, 2013 1:43 am
by lnevo
2.5

Most people run it *after* feeding mode.

Re: Setting Nutrient Mode when in Feeding Mode.

Posted: Thu Jun 20, 2013 8:44 am
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?

Re: Setting Nutrient Mode when in Feeding Mode.

Posted: Thu Jun 20, 2013 9:07 am
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.

Re: Setting Nutrient Mode when in Feeding Mode.

Posted: Fri Jun 21, 2013 5:46 pm
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 //

Re: Setting Nutrient Mode when in Feeding Mode.

Posted: Fri Jun 21, 2013 11:30 pm
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.