It is possible to make your MP speeds variable instead of a set speed...even with stock modes.
This uses the ReefCrestMode() function that lnevo found.
I enjoy ShortWave (Short pulse) the most...but I wanted a way to vary the speed...so this is good for anyone who wants the same throughout the day.
Here's how I do it.
Before setup()
Code: Select all
// Default Mode
byte vtMode=ShortWave;
byte vtSpeed=30;
byte vtDuration=7;
//ReefCrest randomization int
int rcSpeed;
Code: Select all
rcSpeed=ReefCrestMode(vtSpeed);
if (ReefAngel.PWM.GetActinicValue()<10)
{
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(Night,10,0);
}
else
{
if (ReefAngel.RF.Mode==Night) ReefAngel.RF.SetMode(Feeding_Stop,0,0); //Temp fix for coming out of Night mode
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(vtMode, rcSpeed, vtDuration); //set RF normal ShortWave, new varying speed, normal duration
}
Code: Select all
byte ReefCrestMode(int s)
{
static unsigned long lastmillis=millis();
static int newspeed=s;
if ((millis()-lastmillis) > 5000)
{
int delta;
delta=random(20);
if (delta<10) newspeed--;
else newspeed++;
newspeed=constrain(newspeed,s-10,s+10); //allows -10 or +10 speed increase or decrease
newspeed=constrain(newspeed,0,100);
lastmillis=millis();
}
return newspeed;
}
View how it looks here:
http://forum.reefangel.com/status/chart ... filter=rfs