Invert Analog LED strips

Hi,

From what I’ve found, there doens’t seem to be any support for Analog RGB Led strips that have their logic inverted. I got that working by adding

  #ifdef WLED_ANALOG_LEDS_INVERT
    r = 255-r;
    g = 255-g;
    b = 255-b;
    w = 255-w;
    w2 = 255-w2;
  #endif

at the start of the SetRgbwPwm function in NpbWrapper.h file, and then in my platform_override.ini, set that build flag as well.

Is this something that could be added?

Regards,
Kester

Hi,

I’m looking for something like this to drive N MOSFETs which need logic high (when the LEDs should be turned on).

Only problem, I don’t know how to change the file correctly.


Is this part right?
And how do I change the platform_override.ini?

Kind regards, Max

I don’t have my custom build here, so can’t check. But the idea is that you can define

WLED_ANALOG_LEDS_INVERT

in there, just like you define other configuration options.
Have you been able to build wled for your configuration already? If so, that flow should have told you to create this platform_overfide.ini file. Or if you didn’t create such, you use a standard configuration in platform.ini - you could just modify that one as well.
Alternatively, just define it in the header file directly, or remove the #ifdef. That’s only there to make it more generic, but it wasn’t picked up by any developer unfortunately…

-Kester