PWM Slope Code
-
- Posts: 19
- Joined: Thu Mar 06, 2014 5:02 pm
- Location: Hewitt NJ
PWM Slope Code
Does this code look correct?
Daylights on a 2:00PM ramp up from 15%-60% over 60 minutes. Then ramp down from 60% to 15% and turn off at 10:30PM to 0%
Actinics on at 1:30PM ramp up from 15%-80% over 60 minutes. Then ramp down from 80% to 15% but turn off at 11:00PM to 0%
ReefAngel.PWM.SetDaylight( PWMSlope(14,0,22,30,15,60,60,0) );
ReefAngel.PWM.SetActinic( PWMSlope(13,30,23,0,15,80,60,0) );
Daylights on a 2:00PM ramp up from 15%-60% over 60 minutes. Then ramp down from 60% to 15% and turn off at 10:30PM to 0%
Actinics on at 1:30PM ramp up from 15%-80% over 60 minutes. Then ramp down from 80% to 15% but turn off at 11:00PM to 0%
ReefAngel.PWM.SetDaylight( PWMSlope(14,0,22,30,15,60,60,0) );
ReefAngel.PWM.SetActinic( PWMSlope(13,30,23,0,15,80,60,0) );
Re: PWM Slope Code
I believe so. I'm not completely up on that last 0 in the PWMSlope function but I think that's what it does.
If not, there are other ways to get you to zero.
--Colin
If not, there are other ways to get you to zero.
--Colin
Re: PWM Slope Code
This is what Roberto gave me for my moonlights
Which are off between 1pm and 9pm and ramp from 0 to whatever % the Moonphase is that night.
Which are off between 1pm and 9pm and ramp from 0 to whatever % the Moonphase is that night.
Code: Select all
if ( hour()>=13 && hour()<21 )
ReefAngel.PWM.SetChannel( 5, 0 );
else
ReefAngel.PWM.SetChannel( 5, PWMSlope(21,0,13,0,0,MoonPhase() ,60,0) );
Re: PWM Slope Code
Here's the function definition which you can find in Globals.cpp or at http://www.easte.net/RA/html
And old value is the % you want the channel at when it's not doing the scheduled slope.
Code: Select all
byte PWMSlope ( byte startHour,
byte startMinute,
byte endHour,
byte endMinute,
byte startPWM,
byte endPWM,
byte Duration,
byte oldValue
)
Re: PWM Slope Code
Thanks. I knew about that, but "oldValue" wasn't very descriptive.
-
- Posts: 19
- Joined: Thu Mar 06, 2014 5:02 pm
- Location: Hewitt NJ
Re: PWM Slope Code
Thanks all for the reply on that first question. One time other thing that I need cleared up... My actinics will come on at 1:30PMEST. I've read on other threads something regarding changing light % or the slope duration during the (ON lights period) that the changes will not take effect for 24 hours is that correct? If this is true when can I make adjustments that will take effect right away? Like for instance my lights aren't on right now it's 9:46AM maybe I want to adjust my light schedule through portal to end my actinics at 11:30PM would that take effect tonight or after a full 24 hours? I've read after people have made changes to their lights schedules they would stay on at night and not turn off. I'm asking this because I just recently swapped out my old RA yesterday and installed the RA+ and this happened to me last night where the actinics just got stuck a 15% and didn't turn off. The only difference is with the RA+ I changed to using slope instead of parabola.
Re: PWM Slope Code
You'd have to use in-memory settings instead of the in-program setting you're using now for the Portal settings to work.
--Colin
--Colin
-
- Posts: 19
- Joined: Thu Mar 06, 2014 5:02 pm
- Location: Hewitt NJ
Re: PWM Slope Code
I am using internal memory.
Re: PWM Slope Code
I think this:
will override memory settings.
--Colin
Code: Select all
ReefAngel.PWM.SetDaylight( PWMSlope(14,0,22,30,15,60,60,0) );
ReefAngel.PWM.SetActinic( PWMSlope(13,30,23,0,15,80,60,0) );
--Colin
-
- Posts: 19
- Joined: Thu Mar 06, 2014 5:02 pm
- Location: Hewitt NJ
Re: PWM Slope Code
OK so to answer my question.. So this should all take effect today and my lights will turn off at 11:00PM tonight?
cosmith71 wrote:I think this:
will override memory settings.Code: Select all
ReefAngel.PWM.SetDaylight( PWMSlope(14,0,22,30,15,60,60,0) ); ReefAngel.PWM.SetActinic( PWMSlope(13,30,23,0,15,80,60,0) );
--Colin
Re: PWM Slope Code
I should think so.
--Colin
--Colin
-
- Posts: 19
- Joined: Thu Mar 06, 2014 5:02 pm
- Location: Hewitt NJ
Re: PWM Slope Code
Ok hopefully this does it. If they don't turn off ill just manually override them to off and see if they take effect in 24 hours.
cosmith71 wrote:I should think so.
--Colin
Re: PWM Slope Code
I've never heard of that before.
--Colin
--Colin
-
- Posts: 19
- Joined: Thu Mar 06, 2014 5:02 pm
- Location: Hewitt NJ
Re: PWM Slope Code
Ok I uploaded
ReefAngel.PWM.SetDaylight( PWMSlope(14,0,22,30,15,60,60,0) );
ReefAngel.PWM.SetActinic( PWMSlope(13,30,23,0,15,80,60,0) );
Should the percentage values reflect under internal memory within portal? In portal it's showing
Daylights Start 15% End 60% (14,0,22,30,15,60,60,0) );
Actinics Start 15% End 75% (13,30,23,0,15,80,60,0) ); end should be 80%
Do I need to manually change the percent in portal or will it change once it goes through the loop?
ReefAngel.PWM.SetDaylight( PWMSlope(14,0,22,30,15,60,60,0) );
ReefAngel.PWM.SetActinic( PWMSlope(13,30,23,0,15,80,60,0) );
Should the percentage values reflect under internal memory within portal? In portal it's showing
Daylights Start 15% End 60% (14,0,22,30,15,60,60,0) );
Actinics Start 15% End 75% (13,30,23,0,15,80,60,0) ); end should be 80%
Do I need to manually change the percent in portal or will it change once it goes through the loop?
Re: PWM Slope Code
They are separate. The portal values are irrelevant when you've specified times, etc in the code. They won't update, nor will it make any difference what you change them to since you've hard coded the values.
--Colin
--Colin
-
- Posts: 19
- Joined: Thu Mar 06, 2014 5:02 pm
- Location: Hewitt NJ
Re: PWM Slope Code
Ah ok thanks
cosmith71 wrote:They are separate. The portal values are irrelevant when you've specified times, etc in the code. They won't update, nor will it make any difference what you change them to since you've hard coded the values.
--Colin