r/FastLED • u/Prestigious_Ad3440 • Nov 17 '22
Code_samples Fast Led Led Strip turning on wave
Hi,
been using this lib. Pretty awesome work.
Examples are neat also but does not have one that I need :)
I got a white only addressable white led strip.
They divide the TM1903 into 3 groups RGB, which is actually 3 set of white leds.
What I need is a way to write array BGR (yes reversed order due to how installed on board) but I need from off to start blending on function until all leds's lit at 100%.
Start with B0... G0....R0....B1,G1,R1,B2,R2,G2.... and so on, until all lit and will stay on, no more effects. All this blended if possible from B to G to R to B1 to R1 to G1...etc...
Ideas?
3
u/sutaburosu [stavros] Nov 17 '22
To get individual control of each white LED, the simplest method I can think of would be to declare a
bytepointer and set it to the start of the CRGB array:Now
whiteleds[x]can be used to address each LED, where x is 0 to NUM_LEDS * 3 - 1.This sketch is an attempt to create the "wave" you described. That simulator only has RGB LEDs, so this is a bit of a cheat but it kind of works OK.
2
u/Noxonomus Nov 17 '22
I think I'm missing something, if all the leds are white why does it matter if they are rgb or bgr?
Any way if you just want to increase all three leds in each pixel at the same time you can put leds[i].setRGB( j, j, j); where j is the index of a loop that starts at 0 increases in steps until they are at full brightness then stays there. You can put it into a function that only gets called once then never again.
2
u/Jem_Spencer Nov 17 '22
I'd be tempted to create another array of leds, with three times the number of elements. Use FastLED to build your pattern(s) on this array in one colour, say red. Then copy the secondArray[i].r values to your actual array. This way you can use FastLEDs built-in functions on the secondArray.
3
u/International_End425 Nov 17 '22
Are they actually RGB or all White? I’m confused about what you want to happen. Can you provide some more detail? Wave and what you described are confusing me.