Dear all,
I'm working on a project where I'm using 12 led strips with 90 led's each (these are WS2812B led strips).
I'm using the FastLED library (version 3.1) in order to control each led individually.
Because I have 12 different led strips, I declare my CRGB class as follows:
CRGB leds[NUM_STRIPS][NUM_LEDS];
.
If for example I want to control the 33th LED in the 2nd strip I can call:
leds[1][32];
Now FastLED has a lot of build in function which I would like to use, as for example a function which lights up one led strip at once in a certain color:
void fill_solid( struct CRGB * leds, int numToFill, const struct CRGB& color);
But I'm not sure how to pass the first argument to the function when having multiple led strips instead of just one (as in my case).
Can anyone help me with this?
Thanks!
PS:
When using just one led strip the code would look like this:
#include <FastLED.h>
#define NUM_LEDS 90
#define NUM_STRIPS 12
CRGB leds[NUM_LEDS];
uint32_t colorcode = RED;
void setup(void)
{
// Initialize the ledstrip and assign an output pin to the led strip
FastLED.addLeds<NEOPIXEL, 22>(leds, NUM_LEDS);
}
void loop(void)
{
fill_solid(leds, NUM_LEDS, CRGB(colorcode));
}