Hello, could you tell me how i make crossfades effects?

fastled-support
gplus
(Daniel T) #1

Hello, could you tell me how i make crossfades effects? For Example Fade slowly all leds from red to another color…
Now I use
fill_solid( leds, NUM_LEDS, CRGB( Value, Value, Value)
and change with iteration the “value”… I searched hours but found nothing?!
But in the announcement it says new function for crossfades…
By the way very good library :slight_smile:
Many thanks for help!!

(Andrew Tuline) #2

For a beginner, I’d recommend something like:

for (int i=0; i<255; i++) {
fill_solid(leds, NUM_LEDS, CHSV(i, 255,255));
FastLED.show();
delay(10);
}

The crossfades is something totally different and a much more advanced functionality.

(Daniel T) #3

Thanks for your reply. Okay thats the Code that i use actually :slight_smile:

(Andrew Tuline) #4

If you want to see what others have done, here’s a page from a Wiki I’m (slowly) working on:

Get FastLED & examples here:

Mark’s additional demos:
https://gist.github.com/kriegsman

Other notable gists and pastebins:
https://gist.github.com/kriegsman
https://gist.github.com/hsiboy
https://gist.github.com/jpro56
https://gist.github.com/jasoncoon
https://gist.github.com/StefanPetrick



http://pastebin.com/u/atuline

Other Git Repositories


There’s a LOT of stuff there.

(Noel Kuck) #5

Thanks for the wonderful resources!

(Daniel T) #6

Thank you very much! Very nice! Thanks to the programmer of cource too!

(Stefan Petrick) #7

What I did is something like rendering 2 CRGB arrays with different contents - lets call them leds2 and leds3.

For a crossfade I scale down the brightness of both and the sum is the result.

leds2[i].nscale8(x);
leds3[i].nscale8(255-x);
leds[i]=leds2[i]+leds3[i];

For x = 0 you see only leds3, with x=255 you see only leds2, with x = 127 you see both blended.

Here I crossfade constantly between 2 completely independet animations: https://www.youtube.com/watch?v=eXC5PCXHPNo While one animation is unvisible it gets a new random parameter set.

(Stuart Taylor) #8

That’s a pretty neat trick @Stefan_Petrick ​!