Page 1 of 1

PWM Dimming Expansion

Posted: Sat Mar 22, 2014 8:11 pm
by clw143
So if I add this to my code I can control from portal.

Code: Select all

  ReefAngel.PWM.Channel0PWMParabola();
  ReefAngel.PWM.Channel1PWMParabola();
  ReefAngel.PWM.Channel2PWMParabola();
  ReefAngel.PWM.Channel3PWMParabola();
  ReefAngel.PWM.Channel4PWMParabola();
  ReefAngel.PWM.Channel5PWMParabola();
My best guess all these channels will be like the PWM Actinic channel was and my sunrise and sunset code will be the same for all of them. How do I tell it some of them are daylight and to use the actinic offset?

Re: PWM Dimming Expansion

Posted: Sun Mar 23, 2014 4:15 am
by lnevo
You can give each of those lines an argument for their offset.

If you want to use the Actinic offset variable you can reference it with this function

ReefAngel.InternalMemory.ActinicOffset_read();

Re: PWM Dimming Expansion

Posted: Sun Mar 23, 2014 10:38 pm
by clw143
lnevo wrote:ReefAngel.InternalMemory.ActinicOffset_read();
ReefAngel Class does not have InternalMemory.

You mean do this?

Code: Select all

ReefAngel.PWM.Channel0PWMParabola(InternalMemory.ActinicOffset_read());

Re: PWM Dimming Expansion

Posted: Mon Mar 24, 2014 3:40 am
by lnevo
Yes. Exactly sorry for the mistake :)

Re: PWM Dimming Expansion

Posted: Mon Mar 24, 2014 2:18 pm
by clw143
I don't suppose lights off overheat can apply like they did by port with standard lights?

Re: PWM Dimming Expansion

Posted: Mon Mar 24, 2014 4:18 pm
by rimai
It doesn't apply, but you can code your own thing.
Something like this:

Code: Select all

if (ReefAngel.Params.Temp[T1_PROBE]>1200)
{
  ReefAngel.PWM.SetChannel(0,0);
}

Re: PWM Dimming Expansion

Posted: Mon Mar 24, 2014 5:42 pm
by clw143
rimai wrote:

Code: Select all

if (ReefAngel.Params.Temp[T1_PROBE]>1200
... make tartar sauce!

Re: PWM Dimming Expansion

Posted: Tue Mar 25, 2014 6:10 pm
by clw143
I also suppose lights on and lights off will work anymore either with out extra code?

Re: PWM Dimming Expansion

Posted: Tue Mar 25, 2014 6:12 pm
by rimai
Lights On/Off only work for relay ports and standard dimming channels. They do not do anything to the dimming channels.

Re: PWM Dimming Expansion

Posted: Tue Mar 25, 2014 6:55 pm
by clw143
Does something like this work?

Code: Select all

  if ( (ReefAngel.Params.Temp[T1_PROBE]>InternalMemory.OverheatTemp_read()) || (ReefAngel.LightsOff=true) ) ReefAngel.PWM.SetChannel (0,0);
edit: guess not "(did you forget the '&' ?)"

Re: PWM Dimming Expansion

Posted: Tue Mar 25, 2014 7:50 pm
by rimai
There is no such thing as ReefAngel.LightsOff
The easiest way is to use the relay port in ReefAngel.LightsOnPort to assign a value to the channel.
This is what I do on mine:

Code: Select all

  if ((ReefAngel.Relay.RelayMaskOn & (1<<(Radion1-1))) == (1<<(Radion1-1))) // If MaskOn, we override PWM to internal memory value
  {
    ReefAngel.RF.SetChannel(Radion_White,InternalMemory.RadionSlopeEndW_read());
    ReefAngel.RF.SetChannel(Radion_RoyalBlue,InternalMemory.RadionSlopeEndRB_read());
    ReefAngel.RF.SetChannel(Radion_Red,InternalMemory.RadionSlopeEndR_read());
    ReefAngel.RF.SetChannel(Radion_Green,InternalMemory.RadionSlopeEndG_read());
    ReefAngel.RF.SetChannel(Radion_Blue,InternalMemory.RadionSlopeEndB_read());
    ReefAngel.RF.SetChannel(Radion_Intensity,InternalMemory.RadionSlopeEndI_read());
  }
  else
  {
    ReefAngel.RF.ChannelWhiteSlope();
    ReefAngel.RF.ChannelRoyalBlueSlope();
    ReefAngel.RF.ChannelRedSlope();
    ReefAngel.RF.ChannelGreenSlope();
    ReefAngel.RF.ChannelBlueSlope();
    ReefAngel.RF.ChannelIntensitySlope();
  }

Re: PWM Dimming Expansion

Posted: Tue Mar 25, 2014 8:52 pm
by clw143
I don't suppose something like this will work?

Code: Select all

ReefAngel.PWM.SetChannel (0&&1&&2&&3&&4&&5,0);
It does compile.

Re: PWM Dimming Expansion

Posted: Tue Mar 25, 2014 8:55 pm
by rimai
Mathematically, 0&&1&&2&&3&&4&&5 = 0
So, it is the same as this:
ReefAngel.PWM.SetChannel (0,0);