Can you make arrays of CRGB or CHSV colors or do they have to go in a palette? For example CRGB colors[numColors] .
Yes. That’s basically what I did in this example.
Hi @Stephen_Kramer : Yes, you can. Look at my following sketches which illustrate how to create a CRGB array of colors and use those arrays in functions in the sketch:
See line 21 in the above sketch.
See line 20 in the Chase.h tab of the above sketch.
Both have functions that utilize those arrays.
It is worth noting that 24-bit RGB values are the fundamental way that FastLED represents colors, and it is the native “language” that the strips understand. The palettes are just a convenient way to store a set of colors for quick indexing, rather than having to compute or store large numbers of colors.
Thanks. A related question can you have arrays of defined ‘CRGB leds’ strips for example I have 6 strips of different types controlled from 6 pins should I be able to define CRGB ledStripArray[numStrips][numLeds] = {leds0, leds1…} I thought then I could do ledStripArray[ledStripNumber][ledNumber] = color. I tried but no output.
I’m doing this in one of my programs:
#define NUM_LEDS 35
CRGB leds[4][NUM_LEDS];
FastLED.addLeds<APA102, 7,13,BGR>(leds[0],NUM_LEDS);
FastLED.addLeds<APA102, 7,14,BGR>(leds[1],NUM_LEDS);
FastLED.addLeds<APA102, 11,13,BGR>(leds[2],NUM_LEDS);
FastLED.addLeds<APA102, 11,14,BGR>(leds[3],NUM_LEDS);
And can do something like:
leds[2][11] = CRGB(255,255,255);
to set that particular pixel on that one strip.