Problem with Dimming Expansion

Expansion modules and attachments
Post Reply
MDB1029
Posts: 178
Joined: Wed Nov 12, 2014 3:10 pm
Location: An Oklahoman in Ohio

Problem with Dimming Expansion

Post by MDB1029 »

So I have been messing with this for a few days trying to figure out what is wrong but have found no issue with the wiring.

So my lights are on, but I don't know what percentage they are running at which I currently have them set at 30% with the internal memory. I was told my code looked like it was not set up for internal memory though but I thought that is how I had it. Here is my code:

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 <PAR.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.Use2014Screen();  // Let's use 2014 Screen 
    // Ports toggled in Feeding Mode
    ReefAngel.FeedingModePorts = Port1Bit | Port4Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port5Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port2Bit | Port3Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;


    // Ports that are always on
    ReefAngel.Relay.On( Port1 );
    ReefAngel.Relay.On( Port4 );

    ////// Place additional initialization code below here
    

    ////// Place additional initialization code above here
}

void loop()
{
    ReefAngel.StandardHeater( Port2 );
if ( ReefAngel.Params.Temp[T1_PROBE] < (InternalMemory.HeaterTempOn_read() - 10)) { ReefAngel.Relay.On(Port3); };
if ( ReefAngel.Params.Temp[T1_PROBE] > (InternalMemory.HeaterTempOff_read() - 5)) { ReefAngel.Relay.Off(Port3); };
    ReefAngel.SingleATOLow( Port5 );
    ReefAngel.PWM.DaylightPWMSlope();
    ReefAngel.PWM.ActinicPWMSlope();
    ReefAngel.Relay.Set(Port8, now()%21600<10800);
    ////// Place your custom code below here
    

    ////// Place your custom code above here

    // This should always be the last line
    ReefAngel.Portal( "MDB1029" );
    ReefAngel.DDNS( "Reef" ); // Your DDNS is MDB1029-Reef.myreefangel.com
    ReefAngel.ShowInterface();
}

I am really hoping there is something wrong here which someone can show me how to fix.

So my lighting is DIY with LDD drivers so I have the dimming set to 0-5v. I do have channel 0 going to 2 drivers for my whites and channel 1 going to 2 drivers for my blues, Is this a problem?

I am wanting to add the cloud and lightning effect code in here whenever I get the lights working correctly so I don't know if that will change how the code needs to be or not.

On a sidenote, I can't manage to figure out how to run my fuge light. I try to use the wizard and it adds a relay expansion and uses 2 ports there, but all i really want is port 7 to run from 6pm until 10am, I would really appreciate a line of code for this.


Any help with this is greatly appreciated
Image
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Problem with Dimming Expansion

Post by binder »

it only appears that you are using the onboard pwm ports. nothing is referencing your expansion dimming module. i do not know what that code is offhand but it appears to be non existent.


Sent from my iPad mini
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Problem with Dimming Expansion

Post by binder »

MDB1029 wrote: On a sidenote, I can't manage to figure out how to run my fuge light. I try to use the wizard and it adds a relay expansion and uses 2 ports there, but all i really want is port 7 to run from 6pm until 10am, I would really appreciate a line of code for this.
Insert these lines between the "/// Place your custom code below here" and the "/// Place your custom code above here".
The code reads as follows:
if the hour is greater than or equal to 18:00 (which is 6pm) OR if the hour is less than or equal to 10:00, turn on Port 7 of the relay box. Otherwise, if the hour falls outside of that range, turn off Port 7.
The hours run from 0-23. So to span midnight, you need the OR statement to catch both ranges.

Code: Select all

if((hour() >= 18) || (hour() <= 10)) {
    ReefAngel.Relay.On(Port7);
} else {
    ReefAngel.Relay.Off(Port7);
}
Post Reply