New Setup, Need Help w/RF

Do you have a question on how to do something.
Ask in here.
Post Reply
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: New Setup, Need Help w/RF

Post by rimai »

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.
Roberto.
robmwpropane
Posts: 78
Joined: Mon Oct 31, 2016 12:33 pm

Re: New Setup, Need Help w/RF

Post by robmwpropane »

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?


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


}
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: New Setup, Need Help w/RF

Post by rimai »

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.
Roberto.
robmwpropane
Posts: 78
Joined: Mon Oct 31, 2016 12:33 pm

Re: New Setup, Need Help w/RF

Post by robmwpropane »

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.
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.
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: New Setup, Need Help w/RF

Post by rimai »

lucky u :)
Roberto.
robmwpropane
Posts: 78
Joined: Mon Oct 31, 2016 12:33 pm

Re: New Setup, Need Help w/RF

Post by robmwpropane »

I'm still haveing a bit of trouble understanding. What does this line do?

Code: Select all

if (ReefAngel.DisplayedMenu!=FEEDING_MODE || ReefAngel.DisplayedMenu!=WATERCHANGE_MODE)
and especially in conjunction with this;

Code: Select all

if (hour()>=15 && hour()<=17) //----------Between 3pm and 5 pm
Original code (the only thing I've changed is the comments);

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
    }
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?

Code: Select all

else if (hour()>=22 || hour()<7)
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!! :D
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: New Setup, Need Help w/RF

Post by rimai »

You got it.
!= means NOT
&& means AND
|| means OR
Roberto.
Post Reply