Code for only first part of the slope dimming leds

Do you have a question on how to do something.
Ask in here.
Post Reply
lmolenmaker
Posts: 59
Joined: Tue Nov 12, 2013 5:58 am

Code for only first part of the slope dimming leds

Post by lmolenmaker »

Hi Guys,

Can someone help me to a code where I need my actinic channel ramping up from 3% to 20%, starting at 8am, ending at 9am.

Same for the ramping down , lets say start at 20% down to 3%, from 10pm to 11 pm.

All I can find is is full parabola's and slopes. I just need the ramping up parts and ramping down parts.

If you guys can help me out here, that would be great.

Thanks in advance,

Leslie
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Code for only first part of the slope dimming leds

Post by rimai »

That's what the slope does :)
Roberto.
lmolenmaker
Posts: 59
Joined: Tue Nov 12, 2013 5:58 am

Re: Code for only first part of the slope dimming leds

Post by lmolenmaker »

Hi Roberto,

From my understanding of the slope is that it will ramp up (in my example) to 20% and stay on 20% until 10pm and then ramp down.

That is not what I need. I would like the leds ramp up to 20% in an hour and ramp down at the end. I don't need the middle part of the slope.

The middle part will be taken care of by another rule.

Hope this is a little bit more clear.

Leslie
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Code for only first part of the slope dimming leds

Post by lnevo »

So do the normal slope and then add a statement after that to set those channels to 0%.
lmolenmaker
Posts: 59
Joined: Tue Nov 12, 2013 5:58 am

Re: Code for only first part of the slope dimming leds

Post by lmolenmaker »

Dear Lee,

This is way above my knowledge. But I give it a try.

Is it something like this for the ramping up part?

ReefAngel.PWM.SetActinic( PWMSlope(8,0,0,0,3,20,60,0) );

The way I read the above is at 8am it starts ramping up to 20% for 60 minutes and then it stays at 20% until 11pm, then it ramps down to 3% for 60 minutes.

I am confused.

Leslie
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Code for only first part of the slope dimming leds

Post by lnevo »

Yes that looks good for the slope.

Now you need a statement between 9 and 11 to set the channel to 0.

if (hour()>=9 && hour()<23) ReefAngel.PWM.SetActinic(0);
lmolenmaker
Posts: 59
Joined: Tue Nov 12, 2013 5:58 am

Re: Code for only first part of the slope dimming leds

Post by lmolenmaker »

Dear Lee or Roberto,

ah I see. So the following below is my piece of code, I verified it, which was ok. I changed the values and times a bit, but I am not sure if it is going to do what I want it to do.

all those brackets and equal signs really get me confused. Would you mind having a look at it?

What I want to accomplish is:

*8.30 am actinic ramping up to 20% for 60 minutes
* then the parabola rules take it over until 21.30
* then at 21.30 actinic ramping down to 0% for 60 minutes

Thanks in advance.

Leslie

Code: Select all

 if (( hour()>=9) && (minute()>30) && ( hour()<=21) && (minute()<30) )
   {
       ReefAngel.PWM.SetDaylight( PWMParabola(9,30,21,30,3,30,0) );
       ReefAngel.PWM.SetActinic( PWMParabola(9,30,21,30,20,50,0) );
   }
           
     else
      
       ReefAngel.PWM.SetActinic( PWMSlope(8,30,22,30,0,20,60,0) );
Post Reply