Wavemakers off at night

Do you have a question on how to do something.
Ask in here.
Post Reply
dpitalo
Posts: 39
Joined: Mon Dec 12, 2011 6:45 pm

Wavemakers off at night

Post by dpitalo »

Trying to figure this out...maybe my thinking or logic is backwards. I'd like the two powerheads to go off at night and just have the return pump on...here's the code snippet for the wavemakers

Code: Select all

  if (hour ()>12 || hour ()<21)
  {
  ReefAngel.WavemakerRandom1(Port5,15,60);//Turn on/off Wavemaker 1 random cycles from 15 to 60 seconds
  }
  else
  {
  ReefAngel.Relay.Off(Port5);
  }
  
  if (hour ()>12 || hour ()<21)
  {
  ReefAngel.WavemakerRandom2(Port6,15,60);//Turn on/off Wavemaker 2 random cycles from 15 to 60 seconds
  }
  else
  {
  ReefAngel.Relay.Off(Port6);
  }
The INO compiles fine and uploads, but the wavemakers are not turning off at night.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Wavemakers off at night

Post by rimai »

|| means or
Your logic is always going to be true
Try &&
Roberto.
dpitalo
Posts: 39
Joined: Mon Dec 12, 2011 6:45 pm

Re: Wavemakers off at night

Post by dpitalo »

DOH!
Post Reply