@boolrules Sorry, I don't know what you mean by that answer.
I tried now to divide the LED's into some groups:
#include "FastLED.h"
#define PIN 6
#define NUM_LEDS 40
#define BRIGHTNESS 50
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
#define NUM_SEGMENTS 5
#define NUM_ROWS 8
CRGBArray<NUM_LEDS> leds;
uint8_t hue[NUM_ROWS];
const uint8_t aRowMap[NUM_SEGMENTS][NUM_ROWS] = { { 0, 1, 2, 3, 36, 37, 38, 39 },
{ 4, 5, 6, 7, 8, 33, 34, 35 },
{ 9, 10, 11, 12, 29, 30, 31, 32 },
{13, 14, 23, 24, 25, 26, 27, 28 },
{15, 16, 17, 18, 19, 20, 21, 22 }
};
void setup()
{
Serial.begin(115200);
FastLED.addLeds<LED_TYPE, PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalSMD5050);
FastLED.setBrightness(BRIGHTNESS);
for (int i = 0; i < NUM_SEGMENTS; i++)
{
hue[i] = 255 / NUM_SEGMENTS * i;
}
}
void loop()
{
static uint8_t nCurrentRow =0;
for (int i = 0; i < NUM_ROWS; i++)
{
leds[aRowMap[nCurrentRow][i]] = CHSV(hue[i]++, 255, 255);
}
FastLED.show();
delay(50);
}
The current result is definitely not final, I just wanted to post it.
It divides the LED's into groups (at least this works), but I have no clue how to apply an effect to each individual group at the same time.
Maybe someone else has a better idea?