When set to false, you won't be able to control with app.
That's why the code is set to true on other times than the ones you want to override through code.
New Setup, Need Help w/RF
-
- Posts: 78
- Joined: Mon Oct 31, 2016 12:33 pm
Re: New Setup, Need Help w/RF
Just so I'm on the right track, the code below is;
Memory set to true, use app (or memory) settings
Set to false between the hours of 3pm and 5pm; mode set to longwave 100%, 3 seconds
Set to false between the hours of 10pm and 7pm; mode set to reefcrest 40%, 0 seconds
3 questions;
1.) am I on the right track
2.) what does setting the duration to "0" do
3.) why in the app is there "home" and "away"; ie, what's the difference?
Memory set to true, use app (or memory) settings
Set to false between the hours of 3pm and 5pm; mode set to longwave 100%, 3 seconds
Set to false between the hours of 10pm and 7pm; mode set to reefcrest 40%, 0 seconds
3 questions;
1.) am I on the right track
2.) what does setting the duration to "0" do
3.) why in the app is there "home" and "away"; ie, what's the difference?
Code: Select all
void loop()
{
ReefAngel.StandardHeater( Port1 );
ReefAngel.RF.UseMemory = true;
////// Place your custom code below here
if (ReefAngel.DisplayedMenu!=FEEDING_MODE || ReefAngel.DisplayedMenu!=WATERCHANGE_MODE)
{
if (hour()>=15 && hour()<=17) ////WHAT DO #'s MEAN?
{
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(LongWave,100,3); ////Can I change this to any mode?
}
else if (hour()>=22 || hour()<7) ////WHAT DO #'s MEAN?
{
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(ReefCrest,40,0); ////WHAT DO #'s MEAN?
}
else
{
ReefAngel.RF.UseMemory=true; ////Does this need to be here at the end?
}
////// Place your custom code above here
}
Re: New Setup, Need Help w/RF
I think you are good.
Duration is how long between changes.
Home and away is for different profiles.
You may have internet that blocks incoming from inside you own network. I do. So I have to setup a home with internal ip and away with external IP.
Duration is how long between changes.
Home and away is for different profiles.
You may have internet that blocks incoming from inside you own network. I do. So I have to setup a home with internal ip and away with external IP.
Roberto.
-
- Posts: 78
- Joined: Mon Oct 31, 2016 12:33 pm
Re: New Setup, Need Help w/RF
I see. Both home and away that I have set work weather I'm on my network or not. I have my external ip set for both.rimai wrote:I think you are good.
Duration is how long between changes.
Home and away is for different profiles.
You may have internet that blocks incoming from inside you own network. I do. So I have to setup a home with internal ip and away with external IP.
-
- Posts: 78
- Joined: Mon Oct 31, 2016 12:33 pm
Re: New Setup, Need Help w/RF
I'm still haveing a bit of trouble understanding. What does this line do?
and especially in conjunction with this;
Original code (the only thing I've changed is the comments);
Edit: I think I get it. If in Feeding Mode OR Water Change Mode switch to these settings if between 3pm-5pm, 10pm-7am
What I don't understand is the && or ||. I know what they mean(&& is for both be true, || is for either be true) but I don't understand the logic here. Couldn't the "||" in this line be a "&&" or vice versa?
Edit 2: I think it's because everything starts over at 12am. So it would be only true if after 10pm OR before 7am because the code starts over at 12am and both instances can not be true.
Funny, I'm not going to use this code, I just wanted to dissect it to understand it. If someone could confirm all my ramblings, I'd appreciate it. Thanks!!
Code: Select all
if (ReefAngel.DisplayedMenu!=FEEDING_MODE || ReefAngel.DisplayedMenu!=WATERCHANGE_MODE)
Code: Select all
if (hour()>=15 && hour()<=17) //----------Between 3pm and 5 pm
Code: Select all
void loop()
{
ReefAngel.StandardHeater( Port1 );
ReefAngel.RF.UseMemory = true;
////// Place your custom code below here
if (ReefAngel.DisplayedMenu!=FEEDING_MODE || ReefAngel.DisplayedMenu!=WATERCHANGE_MODE)
{
if (hour()>=15 && hour()<=17) //----------Between 3pm and 5 pm
{
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(LongWave,100,3); //----------LongWave, 100%, 3 seconds
}
else if (hour()>=22 || hour()<7) //----------Between 10pm and 7am
{
ReefAngel.RF.UseMemory=false;
ReefAngel.RF.SetMode(ReefCrest,40,0); //----------ReefCrest, 40%, 0ms
}
else
{
ReefAngel.RF.UseMemory=true; //----------Return to default settings
}
What I don't understand is the && or ||. I know what they mean(&& is for both be true, || is for either be true) but I don't understand the logic here. Couldn't the "||" in this line be a "&&" or vice versa?
Code: Select all
else if (hour()>=22 || hour()<7)
Funny, I'm not going to use this code, I just wanted to dissect it to understand it. If someone could confirm all my ramblings, I'd appreciate it. Thanks!!