Page 1 of 1

moon lights not dimming?

Posted: Wed Jul 11, 2012 10:55 pm
by psyrob
It seems that my moonlights are always the same intensity, full on, even tho I use moonphase()...I have them plugged into my dimming actinic and daylight channels...Do I have this coded wrong?

In setup()

Code: Select all

// Set Actinic and Daylight off by default
  ReefAngel.PWM.SetActinic(0);
    ReefAngel.PWM.SetDaylight(0);
In loop()

Code: Select all

   // PWMSlope based on Internal Memory values for Standard Lights
     ReefAngel.PWM.ActinicPWMSlope();
    ReefAngel.PWM.DaylightPWMSlope();
if ((hour() >= 5) || (hour() <= 22)) //from 10 pm to 5 am the moonlights will be on 
        {   
          ReefAngel.PWM.SetDaylight(MoonPhase());
          ReefAngel.PWM.SetActinic(MoonPhase());
        }     
    else
        {
           ReefAngel.PWM.SetDaylight(0);  //from 5 am to 10 pm the moonlights will be off
              ReefAngel.PWM.SetActinic(0);
          
        } 

Re: moon lights not dimming?

Posted: Thu Jul 12, 2012 7:44 am
by rimai
What % do you see on the screen?

Re: moon lights not dimming?

Posted: Thu Jul 12, 2012 9:29 am
by psyrob
3%

...and while they turned on at the right time, they did not go off this morning at 5, like I thought I had coded...do I have the code right to have the lights go on at 10 pm and off at 5 am?
Thanks

Re: moon lights not dimming?

Posted: Thu Jul 12, 2012 2:09 pm
by rimai
I don't think your logic is right.
Your logic will always be true. It will always be >=5 or <=22.
You need <=5 || >=22
Can you measure the voltage you are getting on the channels?

Re: moon lights not dimming?

Posted: Thu Jul 12, 2012 8:29 pm
by psyrob
I dont know how to measure the voltage, I don't have any volt meters or whatever you need...the pwm channels on the portal read 34%...does that give any useful info?

Re: moon lights not dimming?

Posted: Thu Jul 12, 2012 8:34 pm
by rimai
Humm.. How was it 3% and now it's 34%?
Try deleting this lines:

Code: Select all

    ReefAngel.PWM.ActinicPWMSlope();
    ReefAngel.PWM.DaylightPWMSlope();
They shouldn't be affecting it because it just gets overridden by your if/else statement, but who knows...??
Do you have any other code that would affect the PWM channels?

Re: moon lights not dimming?

Posted: Thu Jul 12, 2012 9:36 pm
by psyrob
I took those lines out and will see what happens tonight...the 3% came from that I didn't have enough space laid out on my screen between the number and the % sign...the % was covering up the 4! LOL
Thanks for the input