Using a WS8201 - i'm trying to address a group of LEDs on the

Using a WS8201 - i’m trying to address a group of LEDs on the chain. I’m using 25 lights, and would like to address a group of 3. Is there a way to call LED[X,Y,Z] or do i have to have a separate line for each?

I’m using Adafruit Trinkets so I need to keep the code small - just looking for an easy way.


Do you always know which array index the group of 3 exists at? I think the easiest is to write a small function on your own to do the work.

void groupofthree(int index, CRGB color)
for (int i = index; i < index + 3; i++) {
leds[i] = color;

There may be a way to use CRGBSet as well, but I haven’t touched that yet.

Not always. I think I may have to address them individually and just limit the number of LEDs available to the designer based off of program space.

@brad_smith1 : What you are looking for is CRGBSet. Use the search box on the left of this webpage to search for “CRGBSet Ken White” or “CRGBSet Daniel Garcia” to find information on what you want to do.

Awesome! Thanks Ken!

You can also say:

leds[x] = leds[y] = leds[z] = color;

(Note that all the various ways to do this will compile down to the same code, roughly - you aren’t saving a whole lot by doing it in “three lines”)