Page 1 of 1

Why aren't all LEDs controlled?

Posted: Thu Jul 17, 2025 1:34 pm
by frankmehlhop
I have an ESP32, a BTF-LIGHTING WS2812B 5M LED light strip and a 5V 10A RS-50-50 power supply unit.
I connect it like this:
Image

And I add this program:

Code: Select all

#include <FastLED.h>
#define NUM_LEDS 20
#define DATA_PIN 2
CRGB leds[NUM_LEDS];
void setup() 
{
  FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
  FastLED.setBrightness(128);
}
void loop() 
{
  for(int i = 0; i <140; i++)
  {
    leds[i] = CRGB::Blue;
    FastLED.show();
    delay(50);
  }
  delay(50);
  for(int i = 0; i <140; i++)
  {
    leds[i] = CRGB::Black;
    FastLED.show();
    delay(50);
  }
}
Only the first 19 LED'S are controlled. The rest of the 140 LED's remain dark.
I tried with two different ESP32 with same result.
What could be the cause?

Re: Why aren't all LEDs controlled?

Posted: Thu Jul 17, 2025 2:16 pm
by frankmehlhop
I would also like to add that some LEDs that come well after the 19th LED still light up with the color and from the previous project. I also find that remarkable.

Re: Why aren't all LEDs controlled?

Posted: Fri Jul 18, 2025 12:10 pm
by frankmehlhop
The reason is because line 2.
I had limited the number to 20 instead of 140.

Thanks,
Frank