Set WP40 to 0% during Feeding

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

Set WP40 to 0% during Feeding

Post by Sacohen »

How can I set WP40 to 0% during feeding?

I'm using a Custom Wave mode that Roberto created

Code: Select all

byte MyCustomWave(byte maxspeed)
{
  static byte randomspeed=0;
  if (now()%11<5)
  {
    return randomspeed;
  }
  else if (now()%11>=5 && now()%11<10)
  {
    return maxspeed;
  }
  else
  {
    randomspeed=random(35,maxspeed);
    return 0;
  }
}
And call your function like this:

Code: Select all

  ReefAngel.PWM.SetActinic(MyCustomWave(70));
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Set WP40 to 0% during Feeding

Post by rimai »

Try this:

Code: Select all

  ReefAngel.PWM.SetActinic(MyCustomWave(70));
  if( ReefAngel.DisplayedMenu==FEEDING_MODE ) ReefAngel.PWM.SetActinic(0);
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Set WP40 to 0% during Feeding

Post by Sacohen »

Thanks. As always.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Set WP40 to 0% during Feeding

Post by Sacohen »

If I wanted the WP40 to go to 30% at night, when the light are off would the code go like this?
My lights are off between 10pm and 12pm.

Code: Select all

  ReefAngel.PWM.SetActinic(MyCustomWave(70));
  if( ReefAngel.DisplayedMenu==FEEDING_MODE ) ReefAngel.PWM.SetActinic(0);
  if (hour()<12 || hour()>=22) ReefAngel.PWM.SetActinic(30);
I am not at home and don't have the Reef Angel program installed at work so

I can't check the coding.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Set WP40 to 0% during Feeding

Post by rimai »

You got it :)
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Set WP40 to 0% during Feeding

Post by Sacohen »

Cool, I figured out my first piece of coding?

I know it's not much, but it's a step in the right direction. :mrgreen:
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Set WP40 to 0% during Feeding

Post by binder »

Sacohen wrote:Cool, I figured out my first piece of coding?

I know it's not much, but it's a step in the right direction. :mrgreen:
awesome. it is always a good feeling when you accomplish that and it works properly. :-)
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: Set WP40 to 0% during Feeding

Post by Sacohen »

Thanks Curt.

I can't say it works properly yet, because I'm at work and have not updated the head unit yet, but if Robert says it will work, that's good enough for me.
Post Reply