How can I get the RGB LED current color?

I wish to replicate the Core’s RGB LED colors in an external LED, but all the functions related to it in the hw_config.h header inside the common-lib don’t return anything, and keep their scopes private, leaving no room to read the color variable. Could I read what’s being outputed to LED2_GPIO_PIN (GPIO_Pin_8), LED3_GPIO_PIN (GPIO_Pin_9) and LED4_GPIO_PIN (GPIO_Pin_10) with some function? I see no other way to get the colors with the current code. I want to maintain cloud firmware flashing, so I can’t fork my own firmware and make the changes I need, otherwise this would be pretty straightforward.

One more thing, would a pull request implementing a uint32_t LED_GetRGBColor(void) function inside the common lib and using it to create a new getColor method in the RGB class be accepted if done properly?

Thanks!

2 Likes

You are always welcome to send a PR and it will be reviewed by the Spark firmware team! :smiley:

I think having this exposed for the user to wire up their own RGD led would be plain awesome.