I have a strip of 150 WS2812 pixels running along my stairs right now. They get triggered from a PIR sensor at the top and the bottom, and right now they do a color chase until the whole strip is lit up. What I would like to be able to do is set up a group of pixels per step so that I have the ability to choose what color I want per step. Is there a way to set up variables or groups somehow so that I can set STAIR3 for example to red instead of having to tell it dot 10 >20?
Funny you should ask - I just added something to FastLED called CRGBSet - which would let you do something like this:
#include<FastLED.h>
…
CRGB rawleds[NUM_LEDS];
CRGBSet leds(rawleds, NUM_LEDS);
CRGBSet stair1(leds(0,4));
CRGBSet stair2(leds(6,9));
CRGBSet stair3(leds(10,14));
…
…
stair1 = CRGB::Red;
etc…
See also https://plus.google.com/102282558639672545743/posts/a3VeZVhRnqG and https://github.com/FastLED/FastLED/wiki/RGBSet-Reference as well as pixelset.h in the fastled directory.
That’s awesome, and exactly what I was looking for!!! Thanks for the quick response.
Your timing couldn’t have been more perfect, I was just wrapping up the initial version of this support. Which likely means that it may have problems, up to and including setting fire to nearby schoolchildren.