Using Float Switch ports for Dimming
Re: Using Float Switch ports for Dimming
I have some ldd drivers I want to hook to my ato port like above. I was wondering about code to slowly dim them up and down for sunrise and set. I new to all this so I don't know much and need help
Re: Using Float Switch ports for Dimming
Start out with this in setup. Use one port or both to fit your needs (i.ie, whites on the lowATO and blues on the highATO).
Then something like this goes in the loop to control the lights. Again, use one port or both.
Here's what the numbers mean.
Turn on at 9:00 AM (9,0) and off at 8:30 PM (20,30). Start at 0% and end at 100% (0,100). Ramp up and down over 60 minutes (60). The final zero is a fallback value, don't worry about changing it. We multiply by 2.55 because PWMSlope returns a value from 0-100 and we need a value from 0-255 for the ATO pins.
So here, the lights will start at 0% and ramp up to 100% from 09:00 to 10:00, then start ramping down again at 7:30 PM (1930) and turn off (0%) at 8:30 PM (2030).
--Colin
Code: Select all
pinMode(lowATOPin,OUTPUT);
pinMode(highATOPin,OUTPUT);
Code: Select all
analogWrite(lowATOPin, (PWMSlope(9,0,20,30,0,100,60,0)*2.55));
analogWrite(highATOPin, (PWMSlope(9,0,20,30,0,100,60,0)*2.55));
Turn on at 9:00 AM (9,0) and off at 8:30 PM (20,30). Start at 0% and end at 100% (0,100). Ramp up and down over 60 minutes (60). The final zero is a fallback value, don't worry about changing it. We multiply by 2.55 because PWMSlope returns a value from 0-100 and we need a value from 0-255 for the ATO pins.
So here, the lights will start at 0% and ramp up to 100% from 09:00 to 10:00, then start ramping down again at 7:30 PM (1930) and turn off (0%) at 8:30 PM (2030).
--Colin
Re: Using Float Switch ports for Dimming
Do it matter where u put it in the setup and loop. And this all I would need to make it work.
Re: Using Float Switch ports for Dimming
Doesn't really matter, except make sure the loop part is before this:
This should be it on the software side.
--Colin
Code: Select all
// This should always be the last line
ReefAngel.ShowInterface();
--Colin