moon lights not dimming?

Expansion modules and attachments
Post Reply
psyrob
Posts: 242
Joined: Thu Sep 01, 2011 8:44 pm

moon lights not dimming?

Post 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);
          
        } 
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: moon lights not dimming?

Post by rimai »

What % do you see on the screen?
Roberto.
psyrob
Posts: 242
Joined: Thu Sep 01, 2011 8:44 pm

Re: moon lights not dimming?

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

Re: moon lights not dimming?

Post 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?
Roberto.
psyrob
Posts: 242
Joined: Thu Sep 01, 2011 8:44 pm

Re: moon lights not dimming?

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

Re: moon lights not dimming?

Post 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?
Roberto.
psyrob
Posts: 242
Joined: Thu Sep 01, 2011 8:44 pm

Re: moon lights not dimming?

Post 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
Image
Post Reply