-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve RGB Driver #6968
Comments
Instead of having RGB_BRIGHTNESS, I might suggest using RGB_COLOR (rr, gg, bb). That would give you complete control of the brightness as well as the color. |
@JimDrewGH
Please, feel free to elaborate further on your suggestion. |
@PilnyTomas - PTAL, thanks. |
I do like the simplicity of the OP's proposal. Maybe to keep it simple you could have some options like RGB_BUILTIN_BLUE that could be used with the simple digitalWrite() function. This way you could at least have a different color other than WHITE. :) |
Hi @JimDrewGH, the color can be controlled by using |
* Improve RGB LED Driver Replaces the use of the `LED_BUILTIN` variable by creating a new variable called `RGB_BUILTIN`. On boards with both a regular LED and RGB LED, this change provides functionality to control either LED. The `LED_BRIGHTNESS` variable is changed to `RGB_BRIGHTNESS`, which aligns more closely with the `RGB_BUILTIN` variable name. `BOARD_HAS_NEOPIXEL` is no longer necessary; it is replaced by `RGB_BUILTIN`. * Update BlinkRGB example Update example code for changes with the RGB driver: - Replace `LED_BUILTIN` and `BOARD_HAS_NEOPIXEL` with `RGB_BUILTIN` - Replace `LED_BRIGHTNESS` with `RGB_BRIGHTNESS` * Update board variants Update board variants for changes with the RGB driver: - Remove `BOARD_HAS_NEOPIXEL` - Define `RGB_BUILTIN` pin - Replace `LED_BRIGHTNESS` with `RGB_BRIGHTNESS` to align with `RGB_BUILTIN` name Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com> Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com>
Related area
Implement
RGB_BUILTIN
variable for (#6808)Hardware specification
Boards with standard LED and RGB LED
Is your feature request related to a problem?
With the implemented solution (#6808) to issue #6783, users are limited to only controlling a regular LED or RGB LED. Boards with both types of LEDs are now constrained to only utilizing one as the built-in LED.
Describe the solution you'd like
Define a new variable
RGB_BUILTIN
for the new RGB driver feature (#6808)LED_BUILTIN
variable in the implementationBOARD_HAS_NEOPIXEL
LED_BRIGHTNESS
to match new variable nameRGB_BRIGHTNESS
This way users that have a regular LED and RGB LED, will be able to utilize the
digitalWrite
functionality on both LEDs. Also, theBlink.ino
andBlinkRGB.ino
example sketches could operate on the LEDs separately.Affected files/lines of code:
LED_BUILTIN
withRGB_BUILTIN
LED_BRIGHTNESS
withRGB_BRIGHTNESS
BOARD_HAS_NEOPIXEL
#define RGB_BUILTIN LED_BUILTIN
LED_BRIGHTNESS
withRGB_BRIGHTNESS
I've tested the proposed changes with the regular
Blink.ino
andBlinkRGB.ino
example sketches, with the following pin definitions:Both sketches operate as expected.
Describe alternatives you've considered
No response
Additional context
I have a pull request ready; however, I thought that I'd start with creating a feature request first.
I have checked existing list of Feature requests and the Contribution Guide
The text was updated successfully, but these errors were encountered: