Can an offset be used on a PWM channel?

Expansion modules and attachments
Post Reply
dadriance
Posts: 36
Joined: Sun Jun 03, 2012 11:04 am

Can an offset be used on a PWM channel?

Post 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?
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post 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
Roberto.
dadriance
Posts: 36
Joined: Sun Jun 03, 2012 11:04 am

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

Post 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.
Image
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

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

Post 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));
Roberto.
dadriance
Posts: 36
Joined: Sun Jun 03, 2012 11:04 am

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

Post 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.
Image
Post Reply