Led Dimming help.. (editing the program)

Hiya. i hope someone can help me.

Ive brought this led controller to dimmer 2 sets of leds on 2 x ELN6048 meanwells.

http://www.boostled.com/products/typhon-led-controller-kit

The problem that im having is that the leds flash when the they're at 10%. (9% no light, 10% they flash and 11% is fine)So i was wondering if there is a way to edit the program so they start up and turn off at around 15%. (instead of starting at 0%)

Code:
http://www.boostled.com/pages/typhon-pre-programmed-sketch

Any help would be amazing.

Thank you

Jimmy

You need to load a library. I think it's called "brain.h" or similar.

Seriously... locate where the brightness is dealt with and play with it. We don't spoon-feed here.

madworm:
You need to load a library. I think it's called "brain.h" or similar.

Seriously... locate where the brightness is dealt with and play with it. We don't spoon-feed here.

If i connect the usb and download the Arduino Software from this site. will i be able to download the software from the board? so i can attempt to edit it?

No, you download the file into your computer. You then edit it and upload it to your board.

could someone have a look at the code and point me in the right direction? :blush:

Well how about posting the code you are trying to change (use the # icon). That link was to lots of functions so we have no idea what bits you are using.

Thats the problem :smiley:

It goes up from 0 to 100 for sunrise. stays at 100% all day. then 100% to 0 for sunset. The problem is that the leds are flashing at 10%
so i want to have it go

off… 15% to 100%, 100% all day then 100% to 15% then off.

Is this going to be too hard for me? Some of it makes sense but i dont know what im looking for as i dont know what bits of code control the pwm percentages.

How can i add an led min like the led max? so it could be zero is off. min = ?? and max =100?

int   setLed(int mins,         // current time in minutes
            int ledPin,        // pin for this channel of LEDs
            int start,         // start time for this channel of LEDs
            int period,        // photoperiod for this channel of LEDs
            int fade,          // fade duration for this channel of LEDs
            int ledMax,        // max value for this channel
            boolean inverted   // true if the channel is inverted
            )  {
  int val = 0;
      
      //fade up
      if (mins > start || mins <= start + fade)  {
        val = map(mins - start, 0, fade, 0, ledMax);
      }
      //fade down
      if (mins > start + period - fade && mins <= start + period)  {
        val = map(mins - (start + period - fade), 0, fade, ledMax, 0);
      }
      //off or post-midnight run.
      if (mins <= start || mins > start + period)  {
        if((start+period)%1440 < start && (start + period)%1440 > mins )
          {
            val=map((start+period-mins)%1440,0,fade,0,ledMax);
          }
        else  
        val = 0; 
      }
    
    
    if (val > ledMax)  {val = ledMax;} 
    if (val < 0) {val = 0; } 
    
  if (inverted) {analogWrite(ledPin, map(val, 0, 100, 255, 0));}
  else {analogWrite(ledPin, map(val, 0, 100, 0, 255));}
  if(override){val=overpercent;}
  return val;

How can i add an led min like the led max?

Like this:-

 if (val < ledMin)  {val = ledMin;}

How would i set the value of minimum?

These are the parts that have the max value. would i just add minimum too?

// Variables making use of EEPROM memory:
EEPROMVar<int> oneStartMins = 750;     // minute to start this channel.
EEPROMVar<int> onePhotoPeriod = 720;   // photoperiod in minutes for this channel.
EEPROMVar<int> oneMax = 100;           // max intensity for this channel, as a percentage
EEPROMVar<int> oneFadeDuration = 60;   // duration of the fade on and off for sunrise and sunset for
                                       //    this channel.
EEPROMVar<int> twoStartMins = 810;
EEPROMVar<int> twoPhotoPeriod = 600;
EEPROMVar<int> twoMax = 100;
EEPROMVar<int> twoFadeDuration = 60;
int oneStartMins = 1380;      // minute to start this channel.
int onePhotoPeriod = 120;   // photoperiod in minutes for this channel.
int oneMax = 100;           // max intensity for this channel, as a percentage
int oneFadeDuration = 60;   // duration of the fade on and off for sunrise and sunset for
                                       //    this channel.                                    
int twoStartMins = 800;
int twoPhotoPeriod = 60;
int twoMax = 100;
int twoFadeDuration = 15;
/****** LED Functions ******/
/***************************/
//function to set LED brightness according to time of day
//function has three equal phases - ramp up, hold, and ramp down

int   setLed(int mins,    // current time in minutes
            int ledPin,  // pin for this channel of LEDs
            int start,   // start time for this channel of LEDs
            int period,  // photoperiod for this channel of LEDs
            int fade,    // fade duration for this channel of LEDs
            int ledMax   // max value for this channel
            )  {
  int val = 0;
      
      //fade up
      if (mins > start || mins <= start + fade)  {
        val = map(mins - start, 0, fade, 0, ledMax);
      }
      //fade down
      if (mins > start + period - fade && mins <= start + period)  {
        val = map(mins - (start + period - fade), 0, fade, ledMax, 0);
      }
      //off or post-midnight run.
      if (mins <= start || mins > start + period)  {
        if((start+period)%1440 < start && (start + period)%1440 > mins )
          {
            val=map((start+period-mins)%1440,0,fade,0,ledMax);
          }
        else  
        val = 0; 
      }
    
    
    if (val > ledMax)  {val = ledMax;} 
    if (val < 0) {val = 0; } 
    
  analogWrite(ledPin, map(val, 0, 100, 0, 255));
  if(override){val=overpercent;}
  return val;
}
void setup() {
  
  // Initialize channel variables. Set LED channel pin and retrieve values from EEPROM
  channel[0].Led = 9;
  channel[0].StartMins = oneStartMins;
  channel[0].PhotoPeriod = onePhotoPeriod;
  channel[0].Max = oneMax;
  channel[0].FadeDuration = oneFadeDuration;

  channel[1].Led = 10;
  channel[1].StartMins = twoStartMins;
  channel[1].PhotoPeriod = twoPhotoPeriod;
  channel[1].Max = twoMax;
  channel[1].FadeDuration = twoFadeDuration;

How would i set the value of minimum?

Oh come on!!!!
Do please put a tiny bit of effort into trying to understand what we are telling you, define it as a global variable:-

int ledMin = 23; // or what ever value you want

In OP's defense, they did try to buy a sort of canned solution, and didn't ask to learn microcontroller programming to get their lights working. I'd suggest contacting the manufacturer directly if there's some kind of problem with the system, though.