First of all, Hello! I’m totally new to WLED and just very recently found out it existence.
From every thing i have seen so far its amazing! Would love to use it with my ledstrips but there is some programming to do.
In my livingroom there is a square ledstip housing (3m x 4m or so) in the ceiling filled to the brim with APA102 leds, 1,887 to be exact.
I run this with a ESP32 with the FastLED library. Because the led strip is is quite long i had a lot of issues with flikkering and datalosses after about 7 meters, so i decided to split the strip in to 2 strips.
One of those strips is now in reverse, if you would count the leds clockwise it would go like. strip1[led 1] till strip1[led 942] strip2[led 945] till strip2[led 1]. Still with me?
With the FastLED library i made a dirty fix (But it works!)
#define DATA_PIN1 23
#define CLK_PIN1 18
#define strip1 942
#define DATA_PIN2 13
#define CLK_PIN2 14
#define strip2 945
#define LED_TYPE APA102
#define COLOR_ORDER BGR
#define NUM_LEDS strip1 + strip2
CRGB leds[NUM_LEDS];
CRGB leds1[strip1];
CRGB leds2[strip2];
CRGB leds2reverse[strip2];
CRGB ledsMain[NUM_LEDS];
FastLED.addLeds<LED_TYPE,DATA_PIN1,CLK_PIN1,COLOR_ORDER,DATA_RATE_MHZ(3)>(ledsMain, strip1).setCorrection(TypicalLEDStrip);
FastLED.addLeds<LED_TYPE,DATA_PIN2,CLK_PIN2,COLOR_ORDER,DATA_RATE_MHZ(3)>(ledsMain, strip1,strip2).setCorrection(TypicalLEDStrip);
void showleds(){
for(int i = 0; i < NUM_LEDS; i++){ // Split total leds array into separate arrays (each strip its own array)
if(i < strip1) {
leds1[i] = leds[i];
} else {
leds2[i - strip1] = leds[i];
}
}
int i = 0;
int j = strip2;
while(i < strip2){ // Reverse second leds strip array
leds2reverse[j] = leds2[i];
i++;
j--;
}
for(int i = 0; i < NUM_LEDS; i++){ // Create one big array from the first led strip, combined with the reversed second strip
if(i < strip1) {
ledsMain[i] = leds1[i];
} else {
ledsMain[i] = leds2reverse[i - strip1];
}
}
FastLED.show();
}
Because FastLED built up an array for the leds then call the function FastLED.show(); to “push” it to the strip i could tweak it in a way to “render” the effects as one Array and the split them up in seperate arrays for the 2 strips.
Now the real question, i have looked through the WLED source code and cant figure out where i could implement a feature like i described.
Does WLED uses a Array like the one used above?
Hope someone can help! Would love to use this with an App and Home assistant