Page 1 of 1

Led strip program

Posted: Wed Dec 23, 2015 12:37 pm
by JDP1130
So i finally got around to building my led strip and it's working great. I have it on a timer to turn on at 10am and off at 11pm. I've recently noticed I'm loosing the color I obtained by switching to t5. So I need to change led schedule. I want leds to come on from 10am to 12pm then back on again at 8pm to 11pm.

Is this doable and if so how.

Re: Led strip program

Posted: Wed Dec 23, 2015 1:51 pm
by lnevo
Add a line to turn off the relay between those hours

if (hour()>=12 && hour()<23) ReefAngel.Relay.Off(Port1);

Re: Led strip program

Posted: Wed Dec 23, 2015 3:02 pm
by JDP1130
Just add under the coinciding port?

Re: Led strip program

Posted: Wed Dec 23, 2015 3:11 pm
by lnevo
Put in custom section so you can reuse easier later but yeah as long as its after the line that turns the port on. Make sure to replace Port1 with what you need to turn off

Re: Led strip program

Posted: Wed Dec 23, 2015 5:23 pm
by JDP1130
so input code now head unit keeps reseting. wont stay loaded. I removed line and still. Only after i removed custome lables did it act right any ideas?


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 = Port3Bit | Port4Bit | Port8Bit;
    ReefAngel.FeedingModePortsE[0] = Port1Bit;
    // Ports toggled in Water Change Mode
    ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port3Bit | Port4Bit | Port8Bit;
    ReefAngel.WaterChangePortsE[0] = Port1Bit;
    // Ports toggled when Lights On / Off menu entry selected
    ReefAngel.LightsOnPorts = 0;
    ReefAngel.LightsOnPortsE[0] = 0;
    // Ports turned off when Overheat temperature exceeded
    ReefAngel.OverheatShutoffPorts = Port1Bit | Port2Bit | Port3Bit;
    ReefAngel.OverheatShutoffPortsE[0] = Port1Bit;
    // Use T1 probe as temperature and overheat functions
    ReefAngel.TempProbe = T1_PROBE;
    ReefAngel.OverheatProbe = T1_PROBE;
    // Set the Overheat temperature setting
    InternalMemory.OverheatTemp_write( 820 );


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

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



ReefAngel.CustomLabels[0]="RETURN";  
ReefAngel.CustomLabels[1]="HEATER";  
ReefAngel.CustomLabels[2]="SKIMMER";  
ReefAngel.CustomLabels[3]="POWER HEADS";  
ReefAngel.CustomLabels[4]="ACTINICS";  
ReefAngel.CustomLabels[5]="DAY LIGHTS";  
ReefAngel.CustomLabels[6]="FAN";  
ReefAngel.CustomLabels[7]="ATO";
ReefAngel.CustomLabels[8]="UV";
ReefAngel.CustomLabels[9]="CABINET LT";
ReefAngel.CustomLabels[10]="FUGE LIGHT";
ReefAngel.CustomLabels[11]= "LED STRIP";
ReefAngel.CustomLabels[12]="UNUSED";
ReefAngel.CustomLabels[13]="UNUSED";
ReefAngel.CustomLabels[14]="UNUSED";
ReefAngel.CustomLabels[15]="UNUSED";

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

void loop()
{
    ReefAngel.StandardHeater( Port2,780,790 );
    ReefAngel.Relay.DelayedOn( Port3,5 );
    ReefAngel.PHControl( Port4,818,822 );
    ReefAngel.StandardLights( Port5,10,0,22,0 );
    ReefAngel.StandardLights( Port6,12,0,20,0 );
    ReefAngel.StandardFan( Port7,790,800 );
    ReefAngel.StandardATO( Port8,60 );
    ReefAngel.StandardLights( Box1_Port1,22,0,8,0 );
    ReefAngel.StandardLights( Box1_Port3,21,0,10,0 );
    ReefAngel.StandardLights( Box1_Port4,8,0,23,0 );
    ReefAngel.PWM.SetDaylight( PWMParabola(9,0,20,0,0,100,0) );
    ReefAngel.PWM.SetActinic( PWMParabola(9,0,20,0,0,100,0) );
    ////// Place your custom code below here
if (hour()>=12 && hour()<23) ReefAngel.Relay.Off( Box1_Port4 );

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

    // This should always be the last line
    
}

Re: Led strip program

Posted: Tue Dec 29, 2015 8:33 pm
by JDP1130
So back end of led code not working. The 7p to 11pm on off function doest work. The am part is ok tho...hmmm

Re: Led strip program

Posted: Wed Dec 30, 2015 7:27 am
by lnevo
Change the hour()<23 to hour()<19

Re: Led strip program

Posted: Wed Dec 30, 2015 6:41 pm
by JDP1130
that did it thanks!

also got custom lables to work.

Re: Led strip program

Posted: Wed Dec 30, 2015 6:45 pm
by JDP1130
can close