Help with shutting off LEDs at 15%

Do you have a question on how to do something.
Ask in here.
Post Reply
jallan258
Posts: 17
Joined: Tue Apr 05, 2011 8:31 am

Help with shutting off LEDs at 15%

Post by jallan258 »

I need some help with my code. As I understand it, the Mean well drivers flicker under 15% so I wanted to have my leds shut off when it reached 15%. Here is my current code.

Code: Select all

// Autogenerated file by RAGen (v1.1.0.126), (01/01/2012 17:05)
// RA_010112_1705.pde
//
// This version designed for v0.8.5 Beta 17 or later

/* The following features are enabled for this PDE File: 
#define DisplayImages
#define DisplayLEDPWM
#define wifi
#define SIMPLE_MENU
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>


void setup()
{
    ReefAngel.Init();  //Initialize controller

    // Ports that are always on
    ReefAngel.Relay.On(Port8);
}

void loop()
{
    // Specific functions
    ReefAngel.StandardATO(Port1);
    ReefAngel.StandardLights(Port2);
    ReefAngel.MHLights(Port3);
    ReefAngel.Wavemaker1(Port4);
    ReefAngel.Wavemaker2(Port5);
    ReefAngel.StandardFan(Port6);
    ReefAngel.StandardHeater(Port7);
 ReefAngel.PWM.SetActinic(PWMSlope(10,30,19,30,15,80,60,ReefAngel.PWM.GetActinicValue()));
 ReefAngel.PWM.SetDaylight(PWMSlope(11,30,18,30,15,80,60,ReefAngel.PWM.GetDaylightValue()));
	ReefAngel.ShowInterface();
}
As you could see I have the PWMSlope function working properly but I can't get it to completely shut off when it reaches 15%. Can someone help me code this? Thank You
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Help with shutting off LEDs at 15%

Post by rimai »

You can start and end the slope with 17% for example and time it to turn the relay off at the end of the slope.
Roberto.
Post Reply