Wavemaker off at night

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Wavemaker off at night

Post by DrewPalmer04 »

I'm trying my best...but this doesn't work..but compiles at least

Code: Select all

if ( (hour()>=7 || hour()<20))
    {
    ReefAngel.WavemakerRandom(Port5,25,60);
 // Turn Port5 on/off random cycles that lasts from 25 to 60 secs
    ReefAngel.Relay.Set(Port6,!ReefAngel.Relay.Status(Port5));
 // Turn Port6 on/off on opposite cycle as Port 5
    }
    else
    {
    ReefAngel.Relay.Off(Port5);
    ReefAngel.Relay.Off(Port6);
    } //Wavemaker on from 0700 to 2000, Off there after
Fix?
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Wavemaker off at night

Post by binder »

Use this instead

Code: Select all

if ( (hour()>=7 && hour()<20))
You were saying OR and this says AND. This code reads when the hour is between 7 and 20.
It was saying if the hour is greater than 7 OR if the hour is less than 20. Both of those scenarios would always have been true.
User avatar
DrewPalmer04
Posts: 818
Joined: Tue May 29, 2012 2:12 pm
Location: Christopher, IL

Re: Wavemaker off at night

Post by DrewPalmer04 »

Thanks!!! Dang that was my next guess :(
Out for now...but not over.

VISIT: Ethernet Module/Wifi Alternative
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Wavemaker off at night

Post by binder »

DrewPalmer04 wrote:Thanks!!! Dang that was my next guess :(
No worries. It's usually the simple things that get us. And believe me, I've made plenty of those simple mistakes myself. :)
Post Reply