Is there a function to fade the LEDs to white (similar to fadeToBlackBy).

Is there a function to fade the LEDs to white (similar to fadeToBlackBy).

I just want my lights to fade to white when I turn them on, and want them to stay White after that.

My code seems to work. Just wondering if there’s a more elegant way of doing this:

#include “FastLED.h”
#define NUM_LEDS 50
#define DATA_PIN 5
CRGB leds[NUM_LEDS];

void setup() {
FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
for (int y=0;y<255;y=y+10){
for (int x=0;x<NUM_LEDS;x++){
leds[x].setRGB(y,y,y);
FastLED.show(); } } }

void loop() {}

I think @Daniel_Garcia has said putting a .show() call inside the setup section can cause problems but I can’t remember any details. But if it works for you then that seems like a good solution.

You can put your .show() call just outside that inner loop though. As it is now it would get called NUM_LEDS times. You only need to call it after you loop over all the leds.

for (int y=0;y<255;y=y+10) {
for (int x=0;x<NUM_LEDS;x++) {
leds[x].setRGB(y,y,y);
}
FastLED.show();
}