Taro-Hayashi / KillerWhale

100 stars 13 forks source link

RGB light vs RGB matrix? #26

Closed Jorres closed 1 month ago

Jorres commented 2 months ago

Hello!

I'm very sorry for posting my third question already and taking much of your time.

In QMK, there are two distinct features: RGB matrix and RGB light. In KillerWhale, all RGB diodes (both under the keys, and a few ones under the keyboard) are configured as RGB light (basically, QMK treats all 66 diodes as one contiguous LED strip).

I can color different parts of the strip in my own colors, as in this example:

const rgblight_segment_t PROGMEM base_layer[] = RGBLIGHT_LAYER_SEGMENTS(
        {0, 3, HSV_PURPLE},
        {3, 24, HSV_RED},
        {27, 1, HSV_PURPLE},
        {28, 2, HSV_RED},
);

produces the following lighting on left half:

image

But it has one very inconvenient consequence: I can control only color of the diodes programmatically, such as HSV, for example, but I can not change brightness and on\off status. Basically, the whole keyboard either is lit, or the whole keyboard is un-lit.

This makes a lot of interesting usecases impossible. I will try to name a few:

Now, the bad part: I'm very bad at hardware, so I don't even understand if it's theoretically possible to change RGB light to RGB matrix programmatically. Maybe it even is impossible due to how wiring has been designed on Killerwhale. So my question is:

  1. Maybe I'm wrong and there is a way to turn on\off diodes when using RGB light?
  2. Why did you go for RGB light instead of RGB matrix? Do you think I can reprogram the keyboard to support RGB matrix, or will it require hardware modifications (and thus basically impossible)?
Taro-Hayashi commented 2 months ago

Hi, Although RGB Matrix can be supported, it cannot be used in the firmware to be distributed for the following reasons

To turn off the LEDs individually, I would have to set the value of V to 0 or specify HSV_BLACK.

Thank you in advance.

Jorres commented 1 month ago

Thank you for your response. Indeed, I didn't understand how HSV worked. For simple usecases turning leds off with HSV_BLACK worked like a charm!

Here is how lower diodes only glow in the dark, for example:

Description

I will test later whether this way is fast enough for complex animations, so that the keyboard still feels responsive. But even if not, a lot of simpler cases can be solved with this workaround, so I'm happy with it.

We still have to figure out manually, which diodes have which ids. For example, the picture above was achieved with

const rgblight_segment_t PROGMEM base_layer[] = RGBLIGHT_LAYER_SEGMENTS(
        {0, 3,   HSV_PURPLE},
        {3, 24,  HSV_BLACK},
        {27, 1,  HSV_PURPLE},
        {28, 2,  HSV_BLACK},
        {33, 3,  HSV_PURPLE},
        {36, 24, HSV_BLACK},
        {60, 1,  HSV_PURPLE},
        {61, 2,  HSV_BLACK}
);

But it's not a big problem as it only has to be done once.