Do you have a question on how to do something.
Ask in here.
Sacohen
Posts: 1833 Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
Post
by Sacohen » Mon May 20, 2013 4:43 pm
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
Post
by rimai » Mon May 20, 2013 5:08 pm
Try this:
Code: Select all
ReefAngel.PWM.SetActinic(MyCustomWave(70));
if( ReefAngel.DisplayedMenu==FEEDING_MODE ) ReefAngel.PWM.SetActinic(0);
Roberto.
Sacohen
Posts: 1833 Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
Post
by Sacohen » Mon May 20, 2013 5:10 pm
Thanks. As always.
Sacohen
Posts: 1833 Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
Post
by Sacohen » Tue May 21, 2013 8:40 am
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
Post
by rimai » Tue May 21, 2013 8:47 am
You got it
Roberto.
Sacohen
Posts: 1833 Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
Post
by Sacohen » Tue May 21, 2013 8:58 am
Cool, I figured out my first piece of coding?
I know it's not much, but it's a step in the right direction.
binder
Posts: 2865 Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:
Post
by binder » Tue May 21, 2013 9:58 am
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.
awesome. it is always a good feeling when you accomplish that and it works properly.
Sacohen
Posts: 1833 Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL
Post
by Sacohen » Tue May 21, 2013 10:12 am
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.