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

LEDs to show status of different states #1475

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Xoffio
Copy link

@Xoffio Xoffio commented Sep 30, 2022

Hi guys. I started to write this code this pass week. with this code i can have an underglow effect that show the status of: keyboard output (ble or usb), ble profile selected, layer selected, and most important the battery status of each device (both devices if you have a split keyboard).

I just find out that someone else is doing something similar but the code has not make it to the main. If this code does not make it to the main, its fine, but, I would give it a try :)

If someone give this the green light then ill make the documentation page.

Thanks.

@Xoffio
Copy link
Author

Xoffio commented Oct 2, 2022

This comment is for people that want to use this functionality. I don't know if this will make it to the main branch, but in the mean time this is how you can use it:

  • Modify your west file to point at this branch. as showed here
  • In your .conf file add the next lines:
# set the underglow effect to the new status effect 
CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=4

# enable or disable each status.
# they are all enable by default
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BATTERY=y
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_LAYER=y
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_OUTPUT=y
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BLE=y
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_CAPS=y

# set the led number to each status.
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BATTERY_N=0
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_LAYER_N=1
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_OUTPUT_N_2
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BLE_N=3
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_CAPS_N=4

# set the color at the first value and at the last value. 
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BATTERY_COLOR_MIN=0
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BATTERY_COLOR_MAX=160

you might use my zmk-config repo as reference.

happy typing!

@idesignstuff
Copy link

Could this be implemented for backlights AND/OR underglow? I have a split keyboard with Xiao ble boards. They have an RGB light on the board where I can address the R/G/B channels individually. I'd like to use them as status lights, but I don't have underglow.

@Xoffio
Copy link
Author

Xoffio commented Dec 28, 2022

Could this be implemented for backlights AND/OR underglow? I have a split keyboard with Xiao ble boards. They have an RGB light on the board where I can address the R/G/B channels individually. I'd like to use them as status lights, but I don't have underglow.

I believe that if you are able to address each led then you are using underglow? If you are using ZMK and can have the underglow option on then just follow the instruction I described in the comment and this should work

vladsolokha added a commit to vladsolokha/zmk-config that referenced this pull request Mar 13, 2023
add the changes to underglow status
zmkfirmware/zmk#1475
@vladsolokha
Copy link

Is there a functionality that can be added to have the battery indicator on multiple leds and have them also respond to brightness settings. If brightness is changed all the LEDs brightness should match.

@sidju
Copy link

sidju commented Feb 21, 2024

Is there a functionality that can be added to have the battery indicator on multiple leds and have them also respond to brightness settings. If brightness is changed all the LEDs brightness should match.

I'm also interested in having battery indication on multiple LEDs. Would making it a span instead of an index be an easy change?

@jasper-clarke
Copy link

jasper-clarke commented Jul 21, 2024

This comment is for people that want to use this functionality. I don't know if this will make it to the main branch, but in the mean time this is how you can use it:

* Modify your `west` file to point at this branch. as showed [here](https://zmk.dev/docs/features/beta-testing)

* In your `.conf` file add the next lines:
# set the underglow effect to the new status effect 
CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=4

# enable or disable each status.
# they are all enable by default
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BATTERY=y
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_LAYER=y
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_OUTPUT=y
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BLE=y
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_CAPS=y

# set the led number to each status.
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BATTERY_N=0
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_LAYER_N=1
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_OUTPUT_N_2
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BLE_N=3
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_CAPS_N=4

# set the color at the first value and at the last value. 
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BATTERY_COLOR_MIN=0
CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BATTERY_COLOR_MAX=160

you might use my zmk-config repo as reference.

happy typing!

@Xoffio
Just wanted to ask I have two OLED Displays on my Corne with Nice Nano V2s but I only use that to see the battery percentage.
I don't want to use the dislpays though because they use so much battery life.
By following these steps which LED's will actually display the battery, as a note also do they display on the NiceNano since I don't have RGB underglow on my keyboard.

@Xoffio
Copy link
Author

Xoffio commented Aug 3, 2024

Hi @jasper-at-windswept,

By following these steps which LED's will actually display the battery

In this case, it will be the LED number 0 -> CONFIG_ZMK_RGB_UNDERGLOW_STATUS_BATTERY_N=0 Set the n led here.
I also tested this with a NiceNano

@jasper-clarke
Copy link

@Xoffio
Thanks very much for that!
Could I ask what the different LED colors are and what status they correspond to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants