Resetting data for Addressable LEDs

I had a working sketch for some strings of Addressable LEDs.
I added another partial string in series with one of the existing ones. Everything still worked.
I changed the number of LEDs in my sketch to control the additional LEDs and uploaded the file. Now none of my lights turn on.
I undid the program change, and uploaded the sketch again. Still none of the lights work.

The change I made was in the LED STRIP 3 section. I changed the NUM_LEDS from 150 to 220.
Like I said it didn't work, so I changed it back and it still doesn't work.

Any ideas?

Thanks.

//---------------------LED STRIP 1-------------------------------
#define NUM_LEDS 150 //number of LEDs on garage
#define DATA_PIN 28  //data pin for lights
CRGB garage[NUM_LEDS]; //light array
//***************************************************************
//-------------------LED STRIP 2----------------------------------
#define NUM_LEDS2 150 // Lights on the house 
#define DATA_PIN2 29 // Data pin for house lights
CRGB house[NUM_LEDS2]; //House light array
//***************************************************************
//----------------------LED STRIP 3------------------------------
#define NUM_LEDS3 150 // Lights on the handrail 
#define DATA_PIN3 30 // Data pin for Handrail lights
CRGB handrail[NUM_LEDS3]; //handrail light array
//*************************************************************
//----------------------LED STRIP 4------------------------------
#define NUM_LEDS4 150 // EXTRA Light Strip
#define DATA_PIN4 31 // Data pin for Extra Light Strip
CRGB leds4[NUM_LEDS4]; //house light array
//*************************************************************

1 Like

Try some known-good example/testing/sample scripts individually on each of your stands on your existing hardware/circuit/connections and see if you can isolate the problem.

I can not think of a reason why reverting the software to the previously working version would no longer work except for the one mentioned below. Which board are you using? Which library for the addressable LEDs. Which addressable LEDs?

Were there any updates for either the board package that you used or the library that you used from the time that you uploaded the the last working version and now? If that is the case, it might indicate a bug in your sketch that now shows. I would suggest that you show your complete sketch.

I don't think that I can help further but those questions might help others to help you.


Your topic does not indicate problems that relate to "avrdude, stk500, bootloader issues" and therefore has been moved to a more suitable location on the forum.

1 Like

A possible hardware reason I can think of is that it powering up the larger strip broke the power supply. But with the given information, it's just guessing.

Debugging step number 1. Load Blink.ino and verify the Arduino works. Seriously.

1 Like

I've included the entire sketch below. (It's long, but is mostly setting variables for different color patterns depending on switch positions)

The power supply still works.
The board is a Mega

Thanks for all the info! I'll do some more testing when I get home tonight.

#include <FastLED.h>
byte RedV = 100; //variable for Red amount
byte GreenV = 100; //variable for green amount
byte BlueV = 100;  //variable for blue amount
byte Lights = 0; //variable for state of lights (on,off,auto)
byte Old_Lights;
byte Pattern = 0 ; //variable for pattern
byte Old_Pattern;
byte Old_RedV;
byte Old_GreenV;
byte Old_BlueV;
byte RandomRed;
byte RandomGreen;
byte RandomBlue;


//---------------------LED STRIP 1-------------------------------
#define NUM_LEDS 150 //number of LEDs on garage
#define DATA_PIN 28  //data pin for lights
CRGB garage[NUM_LEDS]; //light array
//***************************************************************
//-------------------LED STRIP 2----------------------------------
#define NUM_LEDS2 150 // Lights on the house 
#define DATA_PIN2 29 // Data pin for house lights
CRGB house[NUM_LEDS2]; //House light array
//***************************************************************
//----------------------LED STRIP 3------------------------------
#define NUM_LEDS3  150 // Lights on the handrail 
#define DATA_PIN3 30 // Data pin for Handrail lights
CRGB handrail[NUM_LEDS3]; //handrail light array
//*************************************************************
//----------------------LED STRIP 4------------------------------
#define NUM_LEDS4 150 // EXTRA Light Strip
#define DATA_PIN4 31 // Data pin for Extra Light Strip
CRGB leds4[NUM_LEDS4]; //house light array
//*************************************************************

//---------------MOTION SENSOR STUFF---------------------------
byte GarageSensor = 22; //Garage motion sensor pin
byte pirValueG; //gets sets to 1 or 0 to set pin to high or low state
byte DoorSensor = 51; //Front Door Motion Sensor pin
byte pirValueD; //
//*************************************************************
void setup() {
  Serial.begin(9600);
  pinMode(GarageSensor, INPUT);
  pinMode(DoorSensor, INPUT);
  pinMode(2, INPUT_PULLUP); //turns lights on
  pinMode(3, INPUT_PULLUP); // turns lights to auto
  pinMode(4, INPUT_PULLUP); // sets pattern1 variable to 1
  pinMode(5, INPUT_PULLUP); // sets pattern1 variable to 2
  pinMode(6, INPUT_PULLUP); // sets pattern2 varibale to 3
  pinMode(7, INPUT_PULLUP); // sets pattern2 variable to 4
  pinMode(8, INPUT_PULLUP); // adjusts red value up
  pinMode(9, INPUT_PULLUP); // adjust red value down
  pinMode(10, INPUT_PULLUP); // adjusts green value up
  pinMode(11, INPUT_PULLUP); // adjusts green value down
  pinMode(12, INPUT_PULLUP); // adjusts blue value up
  pinMode(13, INPUT_PULLUP); // adjusts blue value down
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(garage, NUM_LEDS); // LED strip 1 info
  FastLED.addLeds<WS2812B, DATA_PIN2, GRB>(house, NUM_LEDS2); //LED Strip 2info
  FastLED.addLeds<WS2812B, DATA_PIN3, GRB>(handrail, NUM_LEDS3); // LED Strip 3 info
  FastLED.addLeds<WS2812B, DATA_PIN4, GRB>(leds4, NUM_LEDS4); //LED strip 4 info
}

void loop()
{


  //-----------SETS "Lights" variable----------------------------
  if (digitalRead (2) == LOW) {
    Lights = 1;
  }
  if (digitalRead (3) == LOW) {
    Lights = 2;
  }
  if (digitalRead (2) == HIGH && digitalRead (3) == HIGH) {
    Lights = 0;
  }
  //---------------------displays the lights, pattern, and color variables on the serial monitor when there is a change in thier value-----------------------
  if  (Lights != Old_Lights) {
    Serial.print("Lights=");
    Serial.println(Lights, DEC);
    Old_Lights = Lights;
  }
  if  (Pattern != Old_Pattern) {
    Serial.print("Pattern=");
    Serial.println(Pattern, DEC);
    Old_Pattern = Pattern;
  }
  if  (RedV != Old_RedV) {
    Serial.print("Red Value=");
    Serial.println(RedV, DEC);
    Serial.print("Green Value=");
    Serial.println(GreenV, DEC);
    Serial.print("Blue Value=");
    Serial.println(BlueV, DEC);
    Old_RedV = RedV;
  }
  if  (GreenV != Old_GreenV) {
    Serial.print("Red Value=");
    Serial.println(RedV, DEC);
    Serial.print("Green Value=");
    Serial.println(GreenV, DEC);
    Serial.print("Blue Value=");
    Serial.println(BlueV, DEC);
    Old_GreenV = GreenV;
  }
  if  (BlueV != Old_BlueV) {
    Serial.print("Red Value=");
    Serial.println(RedV, DEC);
    Serial.print("Green Value=");
    Serial.println(GreenV, DEC);
    Serial.print("Blue Value=");
    Serial.println(BlueV, DEC);
    Old_BlueV = BlueV;
  }
  //----------------------------------------------------------------------------------------------------------------------------------------------------
  //*****************************************************************

  //------------SETS THE "Pattern" VARIABLE---------------------------------------------------------------
  if (digitalRead (4) == HIGH && digitalRead (5) == HIGH && digitalRead (6) == HIGH && digitalRead (7) == HIGH) {
    Pattern = 0; //turns only garage lights on
  }
  if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == HIGH && digitalRead (7) == HIGH) {
    Pattern = 1; // turns all lights on solid to color basecd on user set RGB values
  }
  if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == HIGH && digitalRead (7) == HIGH) {
    Pattern = 2; // Turns all lights on twinkle based on user set RGB values
  }
  if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH) {
    Pattern = 3; // Turns all lights on solid based on Christmas pattern
  }
  if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH) {
    Pattern = 4; // Turns all lights on twinkle based on Christmas pattern
  }
  if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == HIGH && digitalRead (7) == LOW) {
    Pattern = 5; // Turns all lights on solid based on Halloween pattern
  }
  if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == HIGH && digitalRead (7) == LOW) {
    Pattern = 6; // Turns all lights on twinkle based on Halloween pattern
  }
  if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (8) == LOW) {
    Pattern = 7; // Turns all lights on solid based on valetine pattern
  }
  if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (8) == LOW) {
    Pattern = 8; // Turns all lights on Twinkle based on valetine pattern
  }
  if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (10) == LOW) {
    Pattern = 9; // Turns all lights on solid based on St Patricks pattern
  }
  if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (10) == LOW) {
    Pattern = 10; // Turns all lights on Twinkle based on St Patricks pattern
  }
  if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (12) == LOW) {
    Pattern = 11; // Turns all lights on solid based on Water pattern
  }
  if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (12) == LOW) {
    Pattern = 12; // Turns all lights on Twinkle based on Water pattern

    if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (9) == LOW) {
      Pattern = 13; // Turns all lights on solid based on Fire pattern
    }
    if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (9) == LOW) {
      Pattern = 14; // Turns all lights on Twinkle based on Fire pattern
    }
    if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (11) == LOW) {
      Pattern = 15; // Turns all lights on solid based on Gold and Silver pattern
    }
    if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (11) == LOW) {
      Pattern = 16; // Turns all lights on Twinkle based on Gold and Silver pattern
    }
    if (digitalRead (4) == LOW && digitalRead (5) == HIGH && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (13) == LOW) {
      Pattern = 17; // Turns all lights on solid based on Purple and Blue pattern
    }
    if (digitalRead (4) == HIGH && digitalRead (5) == LOW && digitalRead (6) == LOW && digitalRead (7) == HIGH && digitalRead (13) == LOW) {
      Pattern = 18; // Turns all lights on Twinkle based on Purple and Blue pattern
    }
    //*****************************************************************************************************************

    //--------------Changes the Color values----------------------
    if (digitalRead (8) == LOW && RedV < 255 ) {
      RedV = RedV + 1; //increases RedV by 1 every cycle
    }
    if (digitalRead (9) == LOW && RedV > 0   ) {
      RedV = RedV - 1; //Decreases RedV by 1 every cycle
    }
    if (digitalRead (10) == LOW && GreenV < 255 ) {
      GreenV = GreenV + 1; //increases GreenV by 1 every cycle
    }
    if (digitalRead (11) == LOW && GreenV > 0   ) {
      GreenV = GreenV - 1; //Drcreases GreenV by 1 every Cycle
    }
    if (digitalRead (12) == LOW && BlueV < 255 ) {
      BlueV = BlueV + 1; //increaes BlueV by 1 every cycle
    }
    if (digitalRead (13) == LOW && BlueV > 0   ) {
      BlueV = BlueV - 1; //decreases BlueV by 1 every cycle
    }


    //------------------TURN THE GARAGE and HANDRAIL LIGHTS ON SOLID to white ----------------------
    if (Lights == 1 && Pattern == 0)
    {
      fill_solid( &(garage[0]), NUM_LEDS, CRGB(255, 255, 255));
      fill_solid( &(house[0]), NUM_LEDS, CRGB(0, 0, 0));
      fill_solid( &(handrail[0]), NUM_LEDS, CRGB(255, 255, 255));
      fill_solid( &(leds4[0]), NUM_LEDS, CRGB(0, 0, 0));

      FastLED.show();
    }

    //------------------MANUAL TURN ALL LIGHTS ON SOLID to user slected color----------------------
    else if (Lights == 1 && Pattern == 1)
    {
      fill_solid( &(garage[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
      fill_solid( &(house[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
      fill_solid( &(handrail[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
      fill_solid( &(leds4[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
      FastLED.show();
    }
    //------------------AUTO TURN ALL LIGHTS ON SOLID to user slected color----------------------
    else if (Lights == 2 && Pattern == 1 && pirValueG == 0 && pirValueD == 0)
    {
      fill_solid( &(garage[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
      fill_solid( &(house[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
      fill_solid( &(handrail[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
      fill_solid( &(leds4[0]), NUM_LEDS, CRGB(RedV, GreenV, BlueV));
      FastLED.show();
    }
    //---------------TURN ALL THE LIGHTS ON to TWINKLE using user slected color-------------------------
    else if (Lights == 1 && Pattern == 2)
    {
      int a = random(NUM_LEDS);
      if (a < NUM_LEDS) garage[a] = CRGB(RedV, GreenV, BlueV);
      for (int b = 0; b < NUM_LEDS; b++) garage[b].fadeToBlackBy(4);

      int c = random(NUM_LEDS2);
      if (c < NUM_LEDS2) house[c] = CRGB(RedV, GreenV, BlueV);
      for (int d = 0; d < NUM_LEDS2; d++) house[d].fadeToBlackBy(4);

      int e = random(NUM_LEDS3);
      if (e < NUM_LEDS3) handrail[e] = CRGB(RedV, GreenV, BlueV);
      for (int f = 0; f < NUM_LEDS3; f++) handrail[f].fadeToBlackBy(4);

      int g = random(NUM_LEDS4);
      if (g < NUM_LEDS4) leds4[g] = CRGB(RedV, GreenV, BlueV);
      for (int h = 0; h < NUM_LEDS4; h++) leds4[h].fadeToBlackBy(4);


      FastLED.show();
      FastLED.delay(200);               // FastLED delay
    }
    //***************************************************************



    //---------------TURN ALL THE LIGHTS ON SOLID to CHRISTMAS PATTERN (alternating red and green)-------------------------
    else if (Lights == 1 && Pattern == 3)
    {
      for (int x = 0; x < NUM_LEDS; x++)
      {
        if (x % 2 == 0) //Makes the even lights Green
        {
          garage[x] = CRGB(0, 128, 0);
          house[x] = CRGB(0, 128, 0);
          handrail[x] = CRGB(0, 128, 0);
          leds4[x] = CRGB(0, 128, 0);
        }
        else // Makes the odd lights Red
        {
          garage[x] = CRGB(200, 0, 0);
          house[x] = CRGB(200, 0, 0);
          handrail[x] = CRGB(200, 0, 0);
          leds4[x] = CRGB(200, 0, 0);
          FastLED.show();
        }
      }
    }
    //***************************************************************

    //---------------TURN ALL THE LIGHTS ON to CHRISTMAS (red and green) TWINKLE-------------------------
    else if (Lights == 1 && Pattern == 4)
    {
      int a = random(NUM_LEDS);
      if (a % 2) {
        garage[a] = CRGB(250, 0, 0);
      }
      else {
        garage[a] = CRGB(0, 250, 0 );
      }
      for (int b = 0; b < NUM_LEDS; b++) garage[b].fadeToBlackBy(4);

      int c = random(NUM_LEDS);
      if (c % 2) {
        house[c] = CRGB(250, 0, 0);
      }
      else {
        house[c] = CRGB(0, 250, 0 );
      }
      for (int d = 0; d < NUM_LEDS; d++) house[d].fadeToBlackBy(4);

      int e = random(NUM_LEDS);
      if (e % 2) {
        handrail[e] = CRGB(250, 0, 0);
      }
      else {
        handrail[e] = CRGB(0, 250, 0 );
      }
      for (int f = 0; f < NUM_LEDS; f++) handrail[f].fadeToBlackBy(4);

      int g = random(NUM_LEDS);
      if (g % 2) {
        leds4[g] = CRGB(250, 0, 0);
      }
      else {
        leds4[g] = CRGB(0, 250, 0 );
      }
      for (int h = 0; h < NUM_LEDS; h++) leds4[h].fadeToBlackBy(4);


      FastLED.show();
      FastLED.delay(200);               // FastLED delay
    }
    //***************************************************************
    //---------------TURN ALL THE LIGHTS ON SOLID to HALLOWEEN (Purple and Orange)-------------------------
    else if (Lights == 1 && Pattern == 5)
    {
      for (int x = 0; x < NUM_LEDS; x++)
      {
        if (x % 2 == 0)  //Sets the even lights purple
        {
          garage[x] = CRGB(250, 0, 200);
          house[x] = CRGB(250, 0, 200);
          handrail[x] = CRGB(250, 0, 200);
          leds4[x] = CRGB(250, 0, 200);
        }
        else  //Sets the odd lights orange
        {
          garage[x] = CRGB(250, 50, 0);
          house[x] = CRGB(250, 50, 0);
          handrail[x] = CRGB(250, 50, 0);
          leds4[x] = CRGB(250, 50, 0);
          FastLED.show();
        }
      }
    }
    //***************************************************************

    //---------------TURN ALL THE LIGHTS ON to MANUAL HALLOWEEN (purple, and orange) TWINKLE-------------------------
    else if (Lights == 1 && Pattern == 6)
    {
      int a = random(NUM_LEDS);
      if (a % 2) {
        garage[a] = CRGB(250, 0, 200); //Purple
      }
      else {
        garage[a] = CRGB(250, 50, 0 ); // Orange
      }
      for (int b = 0; b < NUM_LEDS; b++) garage[b].fadeToBlackBy(4);

      int c = random(NUM_LEDS);
      if (c % 2) {
        house[c] = CRGB(250, 0, 200);
      }
      else {
        house[c] = CRGB(250, 50, 0 );
      }
      for (int d = 0; d < NUM_LEDS; d++) house[d].fadeToBlackBy(4);

      int e = random(NUM_LEDS);
      if (e % 2) {
        handrail[e] = CRGB(250, 0, 200);
      }
      else {
        handrail[e] = CRGB(250, 50, 0 );
      }
      for (int f = 0; f < NUM_LEDS; f++) handrail[f].fadeToBlackBy(4);

      int g = random(NUM_LEDS);
      if (g % 2) {
        leds4[g] = CRGB(250, 0, 200);
      }
      else {
        leds4[g] = CRGB(250, 50, 0 );
      }
      for (int h = 0; h < NUM_LEDS; h++) leds4[h].fadeToBlackBy(4);


      FastLED.show();
      FastLED.delay(200);               // FastLED delay
    }
    //***************************************************************

    //---------------TURN ALL THE LIGHTS ON SOLID to Valentines PATTERN -------------------------
    else if (Lights == 1 && Pattern == 7)
    {
      for (int x = 0; x < NUM_LEDS; x++)
      {
        if (x % 2 == 0) //Makes the even lights Pink
        {
          garage[x] = CRGB(247, 80, 80);
          house[x] = CRGB(247, 80, 80);
          handrail[x] = CRGB(247, 80, 80);
          leds4[x] = CRGB(247, 80, 80);
        }
        else // Makes the odd lights Red
        {
          garage[x] = CRGB(200, 0, 0);
          house[x] = CRGB(200, 0, 0);
          handrail[x] = CRGB(200, 0, 0);
          leds4[x] = CRGB(200, 0, 0);
          FastLED.show();
        }
      }
    }
    //***************************************************************
    //---------------TURN ALL THE LIGHTS ON to Valentines (red and pink) TWINKLE-------------------------
    else if (Lights == 1 && Pattern == 8)
    {
      int a = random(NUM_LEDS);
      if (a % 2) {
        garage[a] = CRGB(250, 0, 0);
      }
      else {
        garage[a] = CRGB(247, 80, 80);
      }
      for (int b = 0; b < NUM_LEDS; b++) garage[b].fadeToBlackBy(4);

      int c = random(NUM_LEDS);
      if (c % 2) {
        house[c] = CRGB(250, 0, 0);
      }
      else {
        house[c] = CRGB(247, 80, 80);
      }
      for (int d = 0; d < NUM_LEDS; d++) house[d].fadeToBlackBy(4);

      int e = random(NUM_LEDS);
      if (e % 2) {
        handrail[e] = CRGB(250, 0, 0);
      }
      else {
        handrail[e] = CRGB(247, 80, 80);
      }
      for (int f = 0; f < NUM_LEDS; f++) handrail[f].fadeToBlackBy(4);

      int g = random(NUM_LEDS);
      if (g % 2) {
        leds4[g] = CRGB(250, 0, 0);
      }
      else {
        leds4[g] = CRGB(247, 80, 80);
      }
      for (int h = 0; h < NUM_LEDS; h++) leds4[h].fadeToBlackBy(4);


      FastLED.show();
      FastLED.delay(200);               // FastLED delay
    }
    //***************************************************************
    //---------------TURN ALL THE LIGHTS ON SOLID to St Patricks PATTERN -------------------------
    else if (Lights == 1 && Pattern == 9)
    {
      for (int x = 0; x < NUM_LEDS; x++)
      {
        if (x % 2 == 0) //Makes the even lights Green
        {
          garage[x] = CRGB(10, 255, 2);
          house[x] = CRGB(10, 255, 2);
          handrail[x] = CRGB(10, 255, 2);
          leds4[x] = CRGB(10, 255, 2);
        }
        else // Makes the odd lights light Green
        {
          garage[x] = CRGB(100, 255, 100);
          house[x] = CRGB(100, 255, 100);
          handrail[x] = CRGB(100, 255, 100);
          leds4[x] = CRGB(100, 255, 100);
          FastLED.show();
        }
      }
    }
    //***************************************************************
    //---------------TURN ALL THE LIGHTS ON to St Patricks (Light green and green) TWINKLE-------------------------
    else if (Lights == 1 && Pattern == 10)
    {
      int a = random(NUM_LEDS);
      if (a % 2) {
        garage[a] = CRGB(10, 166, 2);
      }
      else {
        garage[a] = CRGB(100, 255, 100);
      }
      for (int b = 0; b < NUM_LEDS; b++) garage[b].fadeToBlackBy(4);

      int c = random(NUM_LEDS);
      if (c % 2) {
        house[c] = CRGB(10, 166, 2);
      }
      else {
        house[c] = CRGB(100, 255, 100);
      }
      for (int d = 0; d < NUM_LEDS; d++) house[d].fadeToBlackBy(4);

      int e = random(NUM_LEDS);
      if (e % 2) {
        handrail[e] = CRGB(10, 166, 2);
      }
      else {
        handrail[e] = CRGB(100, 255, 100);
      }
      for (int f = 0; f < NUM_LEDS; f++) handrail[f].fadeToBlackBy(4);

      int g = random(NUM_LEDS);
      if (g % 2) {
        leds4[g] = CRGB(10, 166, 2);
      }
      else {
        leds4[g] = CRGB(100, 255, 100);
      }
      for (int h = 0; h < NUM_LEDS; h++) leds4[h].fadeToBlackBy(4);


      FastLED.show();
      FastLED.delay(200);               // FastLED delay
    }
    //***************************************************************
    //---------------TURN ALL THE LIGHTS ON SOLID to WATER PATTERN (alternating Blues)-------------------------
    else if (Lights == 

Post an annotated schematic so we can rule out hardware problems. Be sure to show all connections, power, ground, power sources and all other hardware items.

1 Like

I don't have an electronic copy of the schematic so I'll
have to work on that.

The lights worked for months. I added more lights to the one string, and they still worked for 10-15 minutes while I was securing all the lights inplace. It wasn't until AFTER I changed the LED number in the program that they stopped working.

Is it possible that uploading the new sketch while the existing sketch was running would cause some sort issue?

This is not possible. You can not add WS2812 and the added portion work with the previous code because the added WS2812 are not addressed. If "they worked" then your original code was bad.

You probably added the WS2812 backwards (DOUT to DOUT... DIN arrow going the wrong way).

No. It is more likely that you have a hardware, wiring or power supply problem

1 Like

Upload a picture of the old/new junction.

1 Like

Test with Blink to make sure the compiling/communication/controller functions:

The wiring between the PS and the strip could have a problem:

Test with some simple scripts to make sure your individual connections, strips, and power connections all work:

I installed the shorter section first so it was powering lights beyond the junction without issue (up to 150 because that's what was set in the sketch)

Are you telling me I can't have a string longer than 150 LEDs? I've never seen a restriction like that.

I tried some other sketches last night and they worked like they should, except for the string I extended. They would work up to the junction.
To clarify, the added section of 70 lights is installed BEFORE the full section of 150. I was powering 80 lights beyond that connection until I made the change in the program that killed everything.

I have these lights outside and I suspect I got some water in the connection point that is causing that issue.

None of this explains why changing the LED count in one string from 150 to 220 would make everything stop working though. I was hooked up to the computer last night and using the serial monitor. All the switches are working like they should. It seems pretty safe to me at this point to rule out a hardware issue. (Other than the bad connection point)

Weak colors, fading, random pixels, are all symptoms similar to yours'.

The issue seems to be a physical property of electricity. The voltage to light each LED drops a little with each LED, eventually dragging the voltage below the minimum required to light an LED. Eventually, signal timing is not strong enough to get the right LEDs to be the right color.

To solve this you will run VCC and GND to about half-way down your string, or if the string is in a loop, to the opposite end, or both. Look up "ws2812 power injection" for a better explanation. Here is one of the links you will find, the Adafruit Uber Guide:

Here is a drawing of "power injection" and different ways to connect it...

I've fixed the connection that had corroded, uploaded some different sketches, and the 220 lights on the longer string, and the other 2 strings of 150 lights all work. I think it's safe to say it's not a hardware problem at this point

Is there still a problem?

Yeah. It works using the examples sketches that come with the fastLED library but not my sketch.

Shouldn't the NUM_LEDS match their strings? It doesn't matter is they're all the same size, but if they have different sizes and you aren't careful about matching sizes to arrays, odd things will happen.

The code in #6 is incomplete and won't compile.

Can you post the complete code for the problematic 220 LEDs on strand 3?

NUM_LEDS
NUM_LEDS2
NUM_LEDS3
NUM_LEDS4

Your sketch lost well over half of the lighting effects, leaving off at St. Paddy's (March)