Page 1 of 1

Dimming Offset

Posted: Tue Aug 12, 2014 10:05 am
by lnevo
Hi,

I was wondering if there was an easy way that I'm missing to use the dimming functions (reading internal memory) to set a real offset. What I mean is that when using the offset argument

ReefAngel.PWM.DaylightPWMParabola();
ReefAngel.PWM.ActinicPWMParabola(30);

The actinic offset will come on 30 minutes before and shutoff 30 minutes after...

What I'm looking to do is have an east/west effect with the lights, so that one fixture comes on 30 minutes before and shuts off 30 minutes before the other (not after).

If there's no straightforward way (not looking to re-read all the memory variables...), then I'm thinking of submitting a patch to the libraries that would maybe have a pre and post argument for offsets..

So it would look more like this...

ReefAngel.PWM.DaylightPWMParabola();
ReefAngel.PWM.ActinicPWMParabola(30,-30);

Thanks in advance.

Re: Dimming Offset

Posted: Tue Aug 12, 2014 10:42 am
by rimai
I don't think there is.

Re: Dimming Offset

Posted: Tue Aug 12, 2014 12:14 pm
by lnevo
Are you ok with the proposed solution? I'll open an issue and create a branch to submit a patch.

Do you think my example was ok? Or should I put it so they are both positive numbers? I put one postive and one negative to kind of show the difference...

So my thinking is this...

ReefAngel.PWM.ActinicPWMParabola(30,30); would be equivalent to ReefAngel.PWM.ActinicPWMParabola(30);

whereas

ReefAngel.PWM.ActinicPWMParabola(30,-30); would be what I was looking to do?

Thoughts?

Re: Dimming Offset

Posted: Tue Aug 12, 2014 1:06 pm
by rimai
I think negative should work exactly like you mentioned. Just make sure to not step over Alan's toes. He's been changing those functions too.
I've got one merge from him still pending.
Also, make sure to get the channels for the expansion module too :)

Re: Dimming Offset

Posted: Tue Aug 12, 2014 1:11 pm
by lnevo
Yeah, I may wait until his patch is in.... anything blocking to merge it :)

For the record, I've been running the DEV version with the high-res changes in it since this weekend. No issues so far.

Re: Dimming Offset

Posted: Tue Aug 12, 2014 3:11 pm
by rimai
It's merged on dev branch.

Re: Dimming Offset

Posted: Wed Aug 13, 2014 2:22 am
by lnevo
Pull request is made :)

Re: Dimming Offset

Posted: Fri Aug 15, 2014 5:53 pm
by lnevo
Yay, Roberto merged this in today :) Thought I would post a pic of the output. I have channel 0 and 2 defined as daylight with a 30 minute offset between them. I have channel 1 and 3 with the actinic offset applied plus the 30 minute offset between each channel. Here's what it looks like.
pwm_channels.png
pwm_channels.png (53.41 KiB) Viewed 5511 times