Addressable is great, but there are some applications where it’s beyond overkill.
My thought was to use more than just the first pixel’s color. I recently started using the ESP32 and it’s possible to handle much more. I am currently working on four, RGBW channels. In my experience, RGB is usually fine with proper support, i.e. white balance/color correction, but that is still down the road.
My first road-block was that SetPixelColor is only getting an indexPixel of 0, even though I changed the code to…
#ifdef WLED_USE_ANALOG_LEDS
if (indexPixel > 3) return; // Ignore all but first four pixels.
if (indexPixel > 3) return; // Ignore all but first four pixels.
should work fine! What you are probably experiencing is that only the color of the 4th pixel (indexPixel == 3) is set. You’ll need a switch statement that sets the correct analog output to set the color to.
Also of course, LED count in LED settings should be at least 4.
I plan to support runtime-configurable multi-strip support soon, including support for as many analog channels as you have PWM pins available
There are two checks if (indexPixel != 0) return; //set analog LEDs from first pixel
in SetPixelColor, one for RGB and one for RGBW.
Have you replaced both?
Took a look and I have no idea why it wouldn’t work… (at least when the LED type is set to RGB)
An issue I had with ESP32 before is that they sometimes seem to enter RGBW mode even though that is not set in the settings. Maybe that is the culprit here, too.
You can try to see if going to LED settings, checking RGBW, saving, unchecking RGBW again, saving and maybe rebooting helps
Back to indexPixel. I see what Def3nder did trying to fix flicker (moving the pixel checking from NpbWrapper.h to FX_fcn.cpp) has been put into the main code.
Would it be best to add a loop somewhere to run through the first n pixels to set the PWM values, or should I do it in FX_fcn.cpp:WS2812FX::setRgbwPwm and replace the “0” used?
as discussed on discord - just for the other ones:
please use the WS2812FX::setRgbwPwm(void) in FX_fcn.cpp
and create a look like
for (i = 0 ; i < 5 ; i++) {
RgbwColor color = bus->GetPixelColorRgbw(i);
byte b = getBrightness();
if (color == _analogLastColor && b == _analogLastBri) return;
set the PWM here ...
}