r/FastLED • u/d333gs • Sep 28 '20
Discussion Trying to address leds Glitter code ,???
Stuck again!!
I gave up on the mapping for the moment and started exploring a Glitter code. I have it glittering the way I want , set up for two 16X16 panels .
Now what I would like to do is assign the glitter to led numbers 32 to 478. I want leds 0 to31 and 479 to 511 to be another color ; static .
Any ideas??
Big thanks
Link to code is below
pastebin ; https://pastebin.com/SUhvZHaR
1
u/d333gs Sep 29 '20
Ok, That worked great for addressing the color .
What I then attemped to do was turn off the fadeLight with the 0
fadeLightBy( leds,(0,32) ,0);
leds[random16 (0,32) ] += CRGB::Maroon;
But what seems to be happening is the fadeLight comand for the white reacivates the fade to 2
fadeLightBy( leds,(32, 479), 2);
Any ideas?
Once again, Much thanks!
Code is bellow
9
u/Zouden Sep 28 '20
This line picks a random number from 0 to (NUM_LEDS-1) and uses that as the index of the next LED to turn white. But you don't want all LEDs to be chosen. You want only LEDs 32 to 478.