Page 1 of 1

Can an offset be used on a PWM channel?

Posted: Tue Nov 27, 2012 9:17 pm
by dadriance
I'm refering to the actinic offset for "standard lighting," can that be used for actinics that are on a PWM expansion? What about reverse cycle for a refugium?

Re: Can an offset be used on a PWM channel?

Posted: Wed Nov 28, 2012 4:52 am
by rimai
You can use the offset like this:

Code: Select all

ReefAngel.PWM.Channel0PWMSlope( InternalMemory.ActinicOffset_read() );
For refugium, the standard slope function can't cross the next day.
Try this:
http://forum.reefangel.com/viewtopic.ph ... 9&start=20

Re: Can an offset be used on a PWM channel?

Posted: Tue Dec 04, 2012 8:58 pm
by dadriance
Thanks Roberto, but I'm at a loss for how to incorporate that into here

Code: Select all

  ReefAngel.PWM.SetChannel( 2, PWMParabola(
  InternalMemory.StdLightsOnHour_read(),
  InternalMemory.StdLightsOnMinute_read(),
  InternalMemory.StdLightsOffHour_read(),
  InternalMemory.StdLightsOffMinute_read(),
  InternalMemory.PWMSlopeStart3_read(),
  InternalMemory.PWMSlopeEnd3_read(),
  0));
Also, is it possible to have more than one offset? I'd like to have channel 2 come on first, folowed by channel 1 about 5 minutes later and then, channel 3, 5 or 10 minutes after that.

Re: Can an offset be used on a PWM channel?

Posted: Tue Dec 04, 2012 10:18 pm
by rimai
It's inside the RA_PWM.cpp file
That's where I got the one you are using, but here it is:

Code: Select all

int MinuteOffset=InternalMemory.ActinicOffset_read();
int onTime=NumMins(InternalMemory.StdLightsOnHour_read(),InternalMemory.StdLightsOnMinute_read())-MinuteOffset;
int offTime=NumMins(InternalMemory.StdLightsOffHour_read(),InternalMemory.StdLightsOffMinute_read())+MinuteOffset;

ReefAngel.PWM.SetChannel( 2, PWMParabola(
onTime/60,
onTime%60,
offTime/60,
offTime%60,
InternalMemory.PWMSlopeStart3_read(),
InternalMemory.PWMSlopeEnd3_read(),
0));

Re: Can an offset be used on a PWM channel?

Posted: Wed Dec 05, 2012 4:57 pm
by dadriance
Thanks again! Clearly, I'm in over my head on this one, I'll have to put this on hold until I understand it better.