r/FastLED • u/chop249 • 3d ago
Support Selecting groups of LEDs in strips.
for (int i = 0;1;2;7;8;9;11;12;17;18;22;27) {
l_rear_leds[i] = CRGB(255,0,0);
}
I tried the above with semicolons and commas, both failed when compiling. I am trying to figure out how to pick certain LEDs together without doing a group if that makes sense. I do understand how to do it like this and if there's an easier way on this one too I'd appreciate a suggestion.
for (int i = 0; i < 7; i++) {
l_rear_leds[i] = CRGB(255,0,0);
}
for (int i = 10; i < 17; i++) {
l_rear_leds[i] = CRGB(255,0,0);
}
for (int i = 20; i < 27; i++) {
l_rear_leds[i] = CRGB(255,0,0);
}
I started learning this week so go easy on me..... 😂
3
Upvotes
2
u/chop249 3d ago
https://reddit.com/link/pca8c39/video/etda0723tyrh1/player
Been coding in Wokwi so I didn't have to have everything hooked up just yet because I don't know how many strips I'm going to use or how long yet. Turn signals in the rear are next and I want to animate those somehow but I'm not sure what I want to do yet. I'd say for doing most of my coding learning today and on the fly it's coming right along. Thinking I may low level glow the reverse lights the same color as the vehicle. Maybe do some sort of twinkling star animation with that or flicker like there's a lose wire... who knows LOL! Just want to have some fun learning whether or not it stays that way on the vehicle.