Moonlight slope using Moon phase monring and night
Posted: Sun May 27, 2012 4:04 pm
I have two of the dimmable moonlights in the two PWM channels on my Relay box. I want them to come on from 8 until 10 at night and again from 7 am to 9am. I tried coding a PWM slope with the Moonphase calculation. Is this possible? This is what I tried.
ReefAngel.PWM.SetActinic(PWMSlope(20,0,9,0,MoonPhase,0,120,MoonPhase));
ReefAngel.PWM.SetDayLight(PWMSlope(20,0,9,0,MoonPhase,0,120,MoonPhase));
This was my original code but the lights never cutoff even when I use the setup code:
// Set Actinic and Daylight off by default
ReefAngel.PWM.SetActinic(0);
ReefAngel.PWM.SetDaylight(0);
This was in my loop code.
if ( hour() >= 20 && hour () <= 22 ) // Moonlights on from 8:00PM to 10PM
{
ReefAngel.PWM.SetActinic(MoonPhase());
ReefAngel.PWM.SetDaylight(MoonPhase());
}
else
if ( hour() >= 7 && hour () <= 9 ) // Moonlights on from 7:00AM to 9AM
{
ReefAngel.PWM.SetActinic(MoonPhase());
ReefAngel.PWM.SetDaylight(MoonPhase());
}
I really like the idea of a slope from the moonphase and back up again.
ReefAngel.PWM.SetActinic(PWMSlope(20,0,9,0,MoonPhase,0,120,MoonPhase));
ReefAngel.PWM.SetDayLight(PWMSlope(20,0,9,0,MoonPhase,0,120,MoonPhase));
This was my original code but the lights never cutoff even when I use the setup code:
// Set Actinic and Daylight off by default
ReefAngel.PWM.SetActinic(0);
ReefAngel.PWM.SetDaylight(0);
This was in my loop code.
if ( hour() >= 20 && hour () <= 22 ) // Moonlights on from 8:00PM to 10PM
{
ReefAngel.PWM.SetActinic(MoonPhase());
ReefAngel.PWM.SetDaylight(MoonPhase());
}
else
if ( hour() >= 7 && hour () <= 9 ) // Moonlights on from 7:00AM to 9AM
{
ReefAngel.PWM.SetActinic(MoonPhase());
ReefAngel.PWM.SetDaylight(MoonPhase());
}
I really like the idea of a slope from the moonphase and back up again.