I tried to minimize the code and this is the simplest block of code with my problem.
If there is 1 show(), only first led lights up
I added one more show() and it works as expected.
Even in the FastLED Blink example, if I want to blink more than 1 led, it always lights up only the first led in the first show() . The subsequence show() can lights up the other leds.
For more details, I'm using Esp8266 Wemos D1 Mini, WS2812B and FastLED library
#include <FastLED.h>
#define NUM_LEDS 24
#define DATA_PIN D6
CRGB leds[NUM_LEDS];
void setup()
{
uint8_t i = 0;
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(50);
for (i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Black;
}
for (i = 0; i < 7; i++) {
leds[i] = CRGB::Red;
}
FastLED.show(); //1st show() lights up only the first led
// FastLED.show(); //2nd show() works as expected
}
void loop() {
}