cookbook/troubleshooting/common-issues.md
Difficulty Level: ⭐ Beginner Time to Complete: 5-10 minutes Prerequisites:
You'll Learn:
Quick reference guide for the most frequently encountered FastLED problems and their solutions.
Possible causes and solutions:
Check power connections (GND and 5V)
Verify data pin matches code
LED_PIN in your code matches the physical pinTry reducing brightness
FastLED.setBrightness(50); // Start with low brightness
Check LED type and color order match your strip
// Make sure these match your actual hardware
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
Symptoms: LEDs light up but show incorrect colors (e.g., red appears green)
Solution: Try different COLOR_ORDER values
// Try each of these in order until colors are correct:
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS); // Most common
FastLED.addLeds<WS2812B, LED_PIN, RGB>(leds, NUM_LEDS);
FastLED.addLeds<WS2812B, LED_PIN, BGR>(leds, NUM_LEDS);
FastLED.addLeds<WS2812B, LED_PIN, BRG>(leds, NUM_LEDS);
FastLED.addLeds<WS2812B, LED_PIN, RBG>(leds, NUM_LEDS);
FastLED.addLeds<WS2812B, LED_PIN, GBR>(leds, NUM_LEDS);
Testing color order:
void testColorOrder() {
leds[0] = CRGB(255, 0, 0); // Should show RED
leds[1] = CRGB(0, 255, 0); // Should show GREEN
leds[2] = CRGB(0, 0, 255); // Should show BLUE
FastLED.show();
}
Common for WS2812B: Use GRB (not RGB)
Symptoms: LEDs flicker, flash randomly, or show unstable colors
Solutions:
Add capacitor across power supply
Ensure solid ground connection
Check power supply capacity
NUM_LEDS × 60mASoftware fixes
// Limit power draw
FastLED.setMaxPowerInVoltsAndMilliamps(5, 2000);
// Reduce brightness
FastLED.setBrightness(100); // Instead of 255
Symptoms: First LED shows wrong color or behavior, but remaining LEDs work correctly
Cause: Signal integrity issue - first LED is most sensitive to data signal quality
Solutions:
Add 220-470Ω resistor on data line
Keep data wire short
Use level shifter for 3.3V to 5V conversion
Check data pin connection
FastLED.show() calledFastLED.clear() or fill_solid(leds, NUM_LEDS, CRGB::Black) in setup()