Page 1 of 1

Wavemakers off at night

Posted: Tue Apr 24, 2012 4:06 pm
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.

Re: Wavemakers off at night

Posted: Tue Apr 24, 2012 4:08 pm
by rimai
|| means or
Your logic is always going to be true
Try &&

Re: Wavemakers off at night

Posted: Tue Apr 24, 2012 4:23 pm
by dpitalo
DOH!