I have the dimmable lunar hub connected to channel 0 of the dimming expansion unit.
This is the code I have for the lunar lights to come on at 10 pm and go off at 8 am.
if (hour()>=22 && hour()<8) // Turn Moonlights on/off
{
ReefAngel.PWM.SetChannel( 0, MoonPhase());
} else
{
ReefAngel.PWM.SetChannel( 0, 0 );
}
Will this code work?
Dimmable lunar hub
Re: Dimmable lunar hub
No it wont. You cant have a logic statement where the hour is greater than 22 AND less than 8. Change the && to || and it will become a logical OR statement instead. So the statement would say if the hour is greater than 22 or if its less than 8.
Re: Dimmable lunar hub
I have changed the code to this:lnevo wrote:No it wont. You cant have a logic statement where the hour is greater than 22 AND less than 8. Change the && to || and it will become a logical OR statement instead. So the statement would say if the hour is greater than 22 or if its less than 8.
if (hour()>=8 && hour()<22) // Turn Moonlights on/off
{
ReefAngel.PWM.SetChannel( 0, (0));
}
else
{
ReefAngel.PWM.SetChannel( 0, MoonPhase());
}
Will this code work now?
Last edited by davaraj on Sun Nov 17, 2013 8:17 am, edited 1 time in total.
Re: Dimmable lunar hub
Thanks.
The light came on at 10 pm. Hope it goes off at 8 am
The light came on at 10 pm. Hope it goes off at 8 am
Re: Dimmable lunar hub
The lunar lights went off at 8am. The code works!
Re: Dimmable lunar hub
Hey guys,
I have a question around the wiring of the hub. I have LEDS connected to ports 0,1,2 and 3 on my Dimmable Expansion Module. Am I correct in thinking I can connect the Moonhub to port 4?
I have a question around the wiring of the hub. I have LEDS connected to ports 0,1,2 and 3 on my Dimmable Expansion Module. Am I correct in thinking I can connect the Moonhub to port 4?
Re: Dimmable lunar hub
You can connect it to the standard dimming ports on the relay box, or any unused channel in your dimming module.
Roberto.
Re: Dimmable lunar hub
Thanks Roberto .. thats what I was hoping for. I'll be using the dimming ports on the relay box to connect my 2 Jebao WP25's .. so port 4 on the dimming module it is .. now to place an order with Reef Angel SA