Skip to content
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

RGB Underglow improvements #65

Open
2 of 7 tasks
Nicell opened this issue Jul 25, 2020 · 5 comments
Open
2 of 7 tasks

RGB Underglow improvements #65

Nicell opened this issue Jul 25, 2020 · 5 comments
Labels
core Core functionality/behavior of ZMK lighting

Comments

@Nicell
Copy link
Member

Nicell commented Jul 25, 2020

Here are a list of improvements still to be made to RGB underglow:

  • Add Kconfig options for underglow state defaults
  • Add settings support for underglow state to persist between resets
  • Add Kconfig options to enable/disable each effect to save on storage space
  • Work towards split support of syncing RGB effects and animations
  • Add support for a "layer" effect that can trigger a underglow color if a specific layer is active
  • Add support for using RGB underglow behavior actions through rotary encoders
  • Convert hsb_to_rgb to use integers instead of floats to improve performance(?)
@Nicell Nicell added the core Core functionality/behavior of ZMK label Jul 25, 2020
@coltontcrowe
Copy link

Are any of these tasks currently being worked on?

@Nicell
Copy link
Member Author

Nicell commented Aug 3, 2021

Are any of these tasks currently being worked on?

The only one currently being worked on is Work towards split support of syncing RGB effects and animations with #547

@coltontcrowe
Copy link

Cool! I want to try to implement the layer functionality, but I’ll probably convert hsb_to_rgb to integers first since that looks like an easy one.

@coltontcrowe
Copy link

I've been working on converting hsb_to_rgb using integers. How worried are we if the conversion means numbers may round differently during the conversion process? I'm noticing a few of the rgb values produced with the function I'm working on are off by 1 compared to the old function.

@idesignstuff
Copy link

How complex would it be to support pwm RGB with this underglow behavior?
I have one RGB led per board on a split (Xiao BLE built-in) and would like to use it to show modes/layers/ble/battery etc.
Currently, because it has a common anode, and each color has its own cathode, they are sort of supported in the backlight, but that can't specify relative brightness, only all of them as a group.

Currently in my .conf file, I have this:

# Uncomment for backlight
CONFIG_ZMK_BACKLIGHT=y

CONFIG_ZMK_BACKLIGHT_AUTO_OFF_IDLE=y
CONFIG_ZMK_BACKLIGHT_BRT_START=50
CONFIG_ZMK_BACKLIGHT_BRT_STEP=10

In the keyboard.dtsi file:

/ {
    chosen {
        zmk,backlight = &backlight;
    };
};

In kconfig.defconfig I have:

if ZMK_BACKLIGHT

config PWM
    default y

config LED_PWM
    default y

endif # ZMK_BACKLIGHT

In keyboard_left.overlay I have:

&pwm0 {
    status = "okay";
    /* Red LED P0_26 or D11, Green LED P0_30 or D12, Blue LED P0_6 or D13 */
    ch0-pin = <26>; /* LED RED */
    ch1-pin = <30>; /* LED GRN */
    ch2-pin = <6>;  /* LED BLU */
}; 
/ {
    backlight: pwmleds {
        compatible = "pwm-leds";
        label = "Backlight LEDs";
        pwm_led_0 {
            pwms = <&pwm0 26>; label = "Backlight LED RED";
        };
        pwm_led_1 {
            pwms = <&pwm0 30>; label = "Backlight LED GRN";
        };
        pwm_led_2 {
            pwms = <&pwm0 6>; label = "Backlight LED BLU";
        };
    };
};  

Is it possible to assign separate values for each color with the current state of ZMK?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core functionality/behavior of ZMK lighting
Projects
None yet
Development

No branches or pull requests

3 participants