Code: Select all
ReefAngel.Timer[1].SetInterval(random(100,900));
So, let's make sure that the number is more than 0.
The line above will randomize the number between 100 and 900.
Code: Select all
ReefAngel.Timer[1].SetInterval(random(100,900));
Sweet. I'll fix the main/original post of the code to put in a min value of say 60, so it will run for a minimum of 60 seconds.cain wrote:this worked with no kinks, TY to Roberto and Curt.
next stop LED.
Code: Select all
ReefAngel.PWM.SetActinic(PWMSlope(13,0,21,0,15,70,90,ReefAngel.PWM.GetActinicValue()));
ReefAngel.PWM.SetDaylight(PWMSlope(13,30,20,0,15,60,60,ReefAngel.PWM.GetDaylightValue()));
please correct me, i want to learn the code so am trying to understand what the numbers mean.rimai wrote: ReefAngel.PWM.SetActinic(PWMSlope(13,0,21,0,15,70,90,ReefAngel.PWM.GetActinicValue()));
Code: Select all
if (hour()<16)
{
ReefAngel.PWM.SetActinic(PWMSlope(13,0,21,0,15,70,60,ReefAngel.PWM.GetActinicValue()));
}
else
{
ReefAngel.PWM.SetActinic(PWMSlope(13,0,21,0,15,70,90,ReefAngel.PWM.GetActinicValue()));
}
If you want to learn the code, here's the actual function definition:cain wrote:please correct me, i want to learn the code so am trying to understand what the numbers mean.rimai wrote: ReefAngel.PWM.SetActinic(PWMSlope(13,0,21,0,15,70,90,ReefAngel.PWM.GetActinicValue()));
13,0 = is the starting time (1pm)
21,0 = end time (9pm)
15 = starting pwm value
70 = final pwm value
90 = minutes to ramp pwm up/down
question, if you want to ramp pwm from 15% to 70% in 60 minutes and ramp down from 70%e to 15% in 90minutes, how do you write the code?
Code: Select all
byte PWMSlope(byte startHour, byte startMinute, byte endHour, byte endMinute, byte startPWM, byte endPWM, byte Duration, byte oldValue)
void setup()
{
randomSeed(analogRead(0));
ReefAngel.Init(); //Initialize controller
ReefAngel.PHMin=526;// 526=PH7.0
ReefAngel.PHMax=813;// 813=PH10.0
// Ports that are always on
ReefAngel.Relay.On(Port8);
ReefAngel.Timer[1].SetInterval(random(30,360));
ReefAngel.Timer[1].Start();
ReefAngel.Relay.On(Port4);
}
void loop()
{
ReefAngel.ShowInterface();
// Specific functions
ReefAngel.StandardATO(Port1);
ReefAngel.StandardLights(Port2);
ReefAngel.MHLights(Port3);
if ( ReefAngel.Timer[1].IsTriggered() )
{
ReefAngel.Timer[1].SetInterval(random(30,360));
ReefAngel.Timer[1].Start();
ReefAngel.Relay.Toggle(Port4);
ReefAngel.Relay.Toggle(Port5);
}
ReefAngel.StandardFan(Port6);
ReefAngel.StandardHeater(Port7);
// Have PWM on from 1p to 9p, with gradual 90 minute ramp up and down for actinic, and 60 minute
ramp up and down for daylight starting at given times
// From 1pm to 2:30p, actinic will slowly ramp up from 15% to 70%, and from 1:30p to 2:30p, daylight
will slowly ramp up from 15% to 60%
// From 7:30p to 9p, actinic will slowly ramp down from 70% to 15%, and from 7p to 8p daylight
will slowly ramp down from 60% to 15%
ReefAngel.PWM.SetActinic(PWMSlope(13,0,21,0,15,70,90,ReefAngel.PWM.GetActinicValue()));
ReefAngel.PWM.SetDaylight(PWMSlope(13,30,20,0,15,60,60,ReefAngel.PWM.GetDaylightValue()));
}
the controller already comes precoded, you don't need to code to use the controller out of the box.fishrme wrote:all these codes look mind bogalling ...i dont know if i will be able to do all that ..im interested in getting a countroller ...but its very intimadating to me aaaaggggggggggggghhhhh ...lol just how easy is this
do you have your RA yet?fishrme wrote:i have a metal halide ,vho,water return pump ,dont have the moonlight but want to add one ,lighting cooling fans ,and 3 koraellia water flow pumps,heater,skimmer....from what i gather if you have the mh bulbs you have to hook it to the computor (am i right on that ) and as far as the wave action goes well i know nothing about that feature ...i have just 3 koraellia that stay on all the time ...im not a computor expert ...is there anyone in here that is not an expert at computors but what i want to know ..how easy is it if your not an expert
tried it and it says sketch is too big.rimai wrote:Was almost there