Invert (make common cathode) RGB LED pins on Startup

Hello,

Is it possible to invert the default RGB pins (RGBR, RGBG, and RGBB) at startup so their logic is common-cathode instead of common anode at startup/bootloading? For example:

STARTUP(RGB.mirrorTo(RGBR, RGBG, RGBB, false, true));

??

I have just tried RGB.mirrorTo() on the standard pins on a Photon and it seems to work.
But since the RGB LED on the board is a common anode it’s not easy to test whether it would do exactly what you want, but flipping the color order worked and going common cathode did render some “different” behaviour :wink:

Just give it a try

@shm45 @ScruffR I tried this with the RGBR, RGBG, and RGBB pads on the back of the Photon with the RGB illuminated push button and I was not able to mirror the RGB to those pads and inverter the logic with success.

I removed the resistors for the onboard LED but that didn’t help either.

It seems the only way to invert the RGB for common-cathode is if you map to different pins that are not the RGBR, RGBG, RGBB pins.

Thanks @ScruffR and @RWB. I found RGB mirroring with a common cathode LED setup to work (mostly) on a custom PCB with a P1:

STARTUP(RGB.mirrorTo(RGBR, RGBG, RGBB, false, true));

with the nets RGB_RED, RGB_GREEN, and RGB BLUE connected to P1 pins 29, 32, and 31, respectively, as shown below:

Mirroring the RGB LED doesn’t work correctly when I placed the P1 into Safe mode or DFU mode via holding the SETUP button and then tapping the RESET button–the CLX6D RGB LED blinks a dim white rapidly in both cases.

But RGB mirroring does work in all other cases I have tried.

3 Likes

Good to know. I only tried it on a Photon, which is where inverting the original RGB pins did not work for me at least but would if mapped to other pins.