Page 1 of 1
How to enable standard dimming function in Portal ?
Posted: Tue Dec 24, 2013 12:35 pm
by lmolenmaker
Hi guys,
Can anybody tell me which piece of code I need in the "setup section" and in the " loop section" in order to enable the standard dimming function in the "portal internal memory section" ?
Thank you so much in advance.
Leslie
Re: How to enable standard dimming function in Portal ?
Posted: Tue Dec 24, 2013 1:38 pm
by lnevo
You dont have to add any code..actually you have to remove code. Show us what your doing for your lights now...
Re: How to enable standard dimming function in Portal ?
Posted: Wed Dec 25, 2013 4:12 am
by lmolenmaker
Hi Lee,
This is the simple code I have at the moment. Please note that my PWM expansion is on the way and then I would like to add my WP25 to one of the channels and control as well through the portal.
Hope you can help me out.
Leslie
Code: Select all
#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <PH.h>
#include <WaterLevel.h>
#include <Humidity.h>
#include <DCPump.h>
#include <ReefAngel.h>
////// Place global variable code below here
////// Place global variable code above here
void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
ReefAngel.SetTemperatureUnit( Celsius ); // set to Celsius Temperature
ReefAngel.Use2014Screen(); // Let's use 2014 Screen
ReefAngel.AddWaterLevelExpansion(); // Water Level Expansion Module
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = 0;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = 0;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = 0;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 0;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 500 );
// Feeeding and Water Change mode speed
ReefAngel.DCPump.FeedingSpeed=0;
ReefAngel.DCPump.WaterChangeSpeed=0;
// ReefAngel.DCPump.ActinicChannel=Sync; // Now you're pump will be affected by the portal settings.
// Ports that are always on/off
ReefAngel.Relay.Off(Port5);
////// Place additional initialization code below here
////// Place additional initialization code above here
}
void loop()
{
ReefAngel.StandardFan( Port1,250,255 );
ReefAngel.StandardLights( Port2,8,0,23,59 );
//ReefAngel.StandardLights( Port3,10,30,22,30 );
ReefAngel.StandardLights( Port4,19,0,19,1 );
ReefAngel.StandardHeater( Port7,245,250 );
ReefAngel.DCPump.UseMemory = false;
//ReefAngel.DCPump.SetMode( ShortPulse,90,165 );
//ReefAngel.DCPump.DaylightChannel = None;
//ReefAngel.DCPump.ActinicChannel = Sync;
////// Place your custom code below here
// ReefAngel.DCPump.UseMemory=true; // Use whatever is in the portal
////////
if (millis() > 1000) // After 1 second
{
if ( (hour() >=18) && (hour() <20) )
ReefAngel.Relay.Off(Port5); // Freshwater ATO off between 18.00 and 20.00, port 5
else
ReefAngel.WaterLevelATO(Port5,30,95,99); // else min level 95% and max level 99%, timeout 30 sec
/////////
if ( (hour() >=18) && (hour() <19) )
ReefAngel.WaterLevelATO(Port6,4000,96,99); // Saltwater ATO on when below 96%, max level 99%, timeout 4000 sec. Port 6 between 18.00 and 19.00
else
ReefAngel.Relay.Off(Port6); // otherwise port 6 off
//////////
ReefAngel.CustomVar[1]=ReefAngel.Relay.Status(Port1); // Fan on email trigger
ReefAngel.CustomVar[4]=ReefAngel.Relay.Status(Port4); // Alk on email trigger
ReefAngel.CustomVar[5]=ReefAngel.Relay.Status(Port5); // Freshwater on email trigger
ReefAngel.CustomVar[7]=255;
///////////
ReefAngel.PWM.SetDaylight( PWMParabola(9,0,21,30,0,30,0) );
ReefAngel.PWM.SetActinic( PWMParabola(8,0,22,45,0,50,0) );
}
////// Place your custom code above here
// This should always be the last line
ReefAngel.Portal( "lmolenmaker" );
ReefAngel.ShowInterface();
}
Re: How to enable standard dimming function in Portal ?
Posted: Wed Dec 25, 2013 5:50 am
by lnevo
ReefAngel.StandardLights(Port4);
Re: How to enable standard dimming function in Portal ?
Posted: Wed Dec 25, 2013 10:34 am
by rimai
I think we are missing one of the keywords.
Try just adding a comment to force it.
Re: How to enable standard dimming function in Portal ?
Posted: Thu Dec 26, 2013 2:40 am
by lmolenmaker
Dear Roberto or Lee,
I do not quite understand. If I want to control my Jebao pump (actinic channel) via the portal I need to do the following:
* put ReefAngel.DCPump.ActinicChannel=Sync; in the setup section and
* put ReefAngel.DCPump.UseMemory = true;
ReefAngel.DCPump.DaylightChannel = None;
ReefAngel.DCPump.ActinicChannel = Sync
in the loop section. All worked fine.
Now I have taken my pump off line until my expansion is in and I want to control my leds via the portal (blues connected to the actinic and whites to the daylight channel).
So do I need to put something similar in the code sections and if so what code and where?
@Lee Port 4 is a dosing pump I run for 1 minute a day
Port 2 is the power supply for the Leds and the dimming leads are connected to the pwm ports
Hope you guys can help me out here.
Leslie
Re: How to enable standard dimming function in Portal ?
Posted: Thu Dec 26, 2013 10:12 am
by rimai
Ahhh.
Now I understand what you want to do.
All you need is this:
Code: Select all
ReefAngel.DCPump.DaylightChannel = None;
ReefAngel.DCPump.ActinicChannel = None;
ReefAngel.DCPump.ExpansionChannel[0] = Sync;
ReefAngel.DCPump.ExpansionChannel[1] = None;
ReefAngel.DCPump.ExpansionChannel[2] = None;
ReefAngel.DCPump.ExpansionChannel[3] = None;
ReefAngel.DCPump.ExpansionChannel[4] = None;
ReefAngel.DCPump.ExpansionChannel[5] = None;
An set either Sync or AntiSync to the channel you will be connecting the Jebao pump.
Re: How to enable standard dimming function in Portal ?
Posted: Thu Dec 26, 2013 11:07 am
by lnevo
I think your misunderstanding roberto...
Jaebos are offline..
Leslie wants to control leds now on those ports...
I think?
Re: How to enable standard dimming function in Portal ?
Posted: Thu Dec 26, 2013 1:39 pm
by lmolenmaker
That's correct Lee.
In the portal's internal memory section there is a tab which says "standard dimming".
I would like to control the leds via that. I just don't want to upload a new code everytime I would like to change the parabola settings.
The code Roberto suggested will help though as soon as my pwm expansion module is in.
I appreciate your help.
Leslie
Re: How to enable standard dimming function in Portal ?
Posted: Thu Dec 26, 2013 2:25 pm
by rimai
Ok...
So here is what you need.
Replace this:
Code: Select all
ReefAngel.PWM.SetDaylight( PWMParabola(9,0,21,30,0,30,0) );
ReefAngel.PWM.SetActinic( PWMParabola(8,0,22,45,0,50,0) );
With this:
Code: Select all
ReefAngel.PWM.DaylightPWMParabola();
ReefAngel.PWM.ActinicPWMParabola();
Then, you will be able to change the parabola settings using the portal.
If you go through the wizard and choose internal memory instead of hard coded settings, it will also generate a code that would use the memory settings that you can change it in the Portal.
Re: How to enable standard dimming function in Portal ?
Posted: Thu Dec 26, 2013 2:38 pm
by lmolenmaker
Thank you.
I will give it a try tonight. I'll let you know the outcome.
You guys are awesome.
Leslie