I have found that this statement does not work as expected:
if (hour()>22 && hour()<9)
{
ReefAngel.PWM.SetActinic(MoonPhase());
ReefAngel.PWM.SetDaylight(MoonPhase());
}
My moonlights were on all the time.
To make my moonlights turn on at 7PM and turn off at 7AM I found:
Added this code to the setup to turn them off by default (power failure etc.):
// Set Actinic and Daylight off by default
ReefAngel.PWM.SetActinic(0);
ReefAngel.PWM.SetDaylight(0);
And then added this code to the loop function:
if ( hour() <= 6 || hour () >= 19 ) // Moonlights on from 7PM to 7AM
{
ReefAngel.PWM.SetActinic(MoonPhase());
ReefAngel.PWM.SetDaylight(MoonPhase());
}
else
{
ReefAngel.PWM.SetActinic(0);
ReefAngel.PWM.SetDaylight(0);
}
Moonphase calculation
Re: Moonphase calculation
Yes, it was a typo that I made. I fixed it on my previous post too.
Thanks for your help!!!
Thanks for your help!!!
Roberto.