PDA

View Full Version : RampUp and RampDown According to Sun


enygma
09/12/2012, 03:10 PM
I would like to write a bit of code for my VDM ports that has my lights ramping up at sunrise and down at sunset. My "RampUp" and "RampDown" profiles are copied directly from the user guide.

Set OFF
If Sun 000/000 Then RampUp
If Sun 060/000 Then ON
If Sun 000/-060 Then RampDown

I want the lights to come on when the sun starts to come up, and RampUp to 75% over the course of an hour (this is what the RampUp profile does). Then when the sun goes down, I want the lights to RampDown (75-0% over the course of 60 minutes) starting an hour before sunset.

I'm thinking that my first and last "if" statements are contradicting each other, as they both relate to sunrise and sunset. How can I improve this/make it work?

enygma
09/12/2012, 03:20 PM
Hmm.

This, maybe?

Set OFF
If Sun 000/0 Then RampUp
If Sun 060/000 Then ON
If Sun 0/-060 Then RampDown

phuzzykins
09/12/2012, 03:55 PM
Please take a look at this thread: http://www.reefcentral.com/forums/showthread.php?t=2019489

enygma
09/12/2012, 04:06 PM
Please take a look at this thread: http://www.reefcentral.com/forums/showthread.php?t=2019489

Thanks, so much, for directing me to that thread!

I didn't realize that "sunrise," "midday," and "sunset" could be used. That really simplifies things. :)

Edit: Second look, and I see that they're virtual outlets that have been created. That makes a lot of sense.