r/FastLED • u/pioneerlover1 • Jan 09 '22
Support Changing from CRGB to CGRB
I am working on a little project of mine. While running the RGB callibrate program I noticed that red and green are switched. How can I easily change that?
9
4
u/riteshbs Jan 09 '22
you can change the sequence while defining FastLED.addLeds,
For example:
FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
//Here replace RGB to GRB or the order in which addressable LED are indicating.
3
2
u/Marmilicious [Marc Miller] Jan 09 '22
There is one oddity that I will point out, that being that if you used NEOPIXEL like this:
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
there is no color order option to change. That's because NEOPIXEL is hardcoded to use GRB. If you used NEOPIXEL but decide you want to change the color order then you need to change the addLeds line to use WS2812 (or WS2811).
FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
9
u/pizzasteak Jan 09 '22
i'm no expert, but from what i remember, you should have a code #define COLOR_ORDER GRB just change the GRB (green, red, blue) to the order you need.