Expansion modules and attachments
clw143
Posts: 116 Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana
Post
by clw143 » Sat Mar 22, 2014 8:11 pm
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?
lnevo
Posts: 5422 Joined: Fri Jul 20, 2012 9:42 am
Post
by lnevo » Sun Mar 23, 2014 4:15 am
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();
clw143
Posts: 116 Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana
Post
by clw143 » Sun Mar 23, 2014 10:38 pm
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());
lnevo
Posts: 5422 Joined: Fri Jul 20, 2012 9:42 am
Post
by lnevo » Mon Mar 24, 2014 3:40 am
Yes. Exactly sorry for the mistake
clw143
Posts: 116 Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana
Post
by clw143 » Mon Mar 24, 2014 2:18 pm
I don't suppose lights off overheat can apply like they did by port with standard lights?
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Mon Mar 24, 2014 4:18 pm
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);
}
Roberto.
clw143
Posts: 116 Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana
Post
by clw143 » Mon Mar 24, 2014 5:42 pm
rimai wrote:
Code: Select all
if (ReefAngel.Params.Temp[T1_PROBE]>1200
... make tartar sauce!
clw143
Posts: 116 Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana
Post
by clw143 » Tue Mar 25, 2014 6:10 pm
I also suppose lights on and lights off will work anymore either with out extra code?
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Tue Mar 25, 2014 6:12 pm
Lights On/Off only work for relay ports and standard dimming channels. They do not do anything to the dimming channels.
Roberto.
clw143
Posts: 116 Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana
Post
by clw143 » Tue Mar 25, 2014 6:55 pm
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 '&' ?)"
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Tue Mar 25, 2014 7:50 pm
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();
}
Roberto.
clw143
Posts: 116 Joined: Fri Jun 21, 2013 8:20 pm
Location: Louisiana
Post
by clw143 » Tue Mar 25, 2014 8:52 pm
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.
rimai
Posts: 12857 Joined: Fri Mar 18, 2011 6:47 pm
Post
by rimai » Tue Mar 25, 2014 8:55 pm
Mathematically, 0&&1&&2&&3&&4&&5 = 0
So, it is the same as this:
ReefAngel.PWM.SetChannel (0,0);
Roberto.