X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=docs%2Ffeature_rgblight.md;h=cba97cb417a84cc546d156d4197f947b40069f79;hb=0456bd668de37f118e717aabf00a132756ea619c;hp=18f2c74e5e7e3c0a44d3e207a0992ec7f164902b;hpb=a860d9d628ae5b99e8c676af4e8226640b53e7d4;p=qmk_firmware.git diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 18f2c74e5..cba97cb41 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -1,123 +1,269 @@ # RGB Lighting -If you've installed addressable RGB lights on your keyboard you can control them with QMK. Currently we support the following addressable LEDs on Atmel AVR processors: +QMK has the ability to control RGB LEDs attached to your keyboard. This is commonly called *underglow*, due to the LEDs often being mounted on the bottom of the keyboard, producing a nice diffused effect when combined with a translucent case. -* WS2811 and variants (WS2812, WS2812B, WS2812C, etc) -* SK6812RGBW +![Planck with RGB Underglow](https://raw.githubusercontent.com/qmk/qmk_firmware/3774a7fcdab5544fc787f4c200be05fcd417e31f/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg) -Some keyboards come with RGB LEDs pre-installed. Others have to have LEDs installed after the fact. See below for information on modifying your keyboard. +Some keyboards come with RGB LEDs preinstalled. Others must have them installed after the fact. See the [Hardware Modification](#hardware-modification) section for information on adding RGB lighting to your keyboard. -## Selecting Colors +Currently QMK supports the following addressable LEDs on AVR microcontrollers (however, the white LED in RGBW variants is not supported): -QMK uses Hue, Saturation, and Value to set color rather than using RGB. You can use the color wheel below to see how this works. Changing the Hue will cycle around the circle. Saturation will affect the intensity of the color, which you can see as you move from the inner part to the outer part of the wheel. Value sets the overall brightness. + * WS2811, WS2812, WS2812B, WS2812C, etc. + * SK6812, SK6812MINI, SK6805 -HSV Color Wheel +These LEDs are called "addressable" because instead of using a wire per color, each LED contains a small microchip that understands a special protocol sent over a single wire. The chip passes on the remaining data to the next LED, allowing them to be chained together. In this way, you can easily control the color of the individual LEDs. -If you would like to learn more about HSV you can start with the [Wikipedia article](https://en.wikipedia.org/wiki/HSL_and_HSV). +## Usage -## Configuration - -Before RGB Lighting can be used you have to enable it in `rules.mk`: - - RGBLIGHT_ENABLE = yes - -You can configure the behavior of the RGB lighting by defining values inside `config.h`. +On keyboards with onboard RGB LEDs, it is usually enabled by default. If it is not working for you, check that your `rules.mk` includes the following: -### Required Configuration - -At minimum you have to define the pin your LED strip is connected to and the number of LEDs connected. - -```c -#define RGB_DI_PIN D7 // The pin the LED strip is connected to -#define RGBLED_NUM 14 // Number of LEDs in your strip +```make +RGBLIGHT_ENABLE = yes ``` -### Optional Configuration +At minimum you must define the data pin your LED strip is connected to, and the number of LEDs in the strip, in your `config.h`. If your keyboard has onboard RGB LEDs, and you are simply creating a keymap, you usually won't need to modify these. + +|Define |Description | +|---------------|---------------------------------------------------------------------------------------------------------| +|`RGB_DI_PIN` |The pin connected to the data pin of the LEDs | +|`RGBLED_NUM` |The number of LEDs connected | +|`RGBLED_SPLIT` |(Optional) For split keyboards, the number of LEDs connected on each half directly wired to `RGB_DI_PIN` | + +Then you should be able to use the keycodes below to change the RGB lighting to your liking. + +### Color Selection + +QMK uses [Hue, Saturation, and Value](https://en.wikipedia.org/wiki/HSL_and_HSV) to select colors rather than RGB. The color wheel below demonstrates how this works. + +HSV Color Wheel + +Changing the **Hue** cycles around the circle. +Changing the **Saturation** moves between the inner and outer sections of the wheel, affecting the intensity of the color. +Changing the **Value** sets the overall brightness. + +## Keycodes + +|Key |Aliases |Description | +|-------------------|----------|--------------------------------------------------------------------| +|`RGB_TOG` | |Toggle RGB lighting on or off | +|`RGB_MODE_FORWARD` |`RGB_MOD` |Cycle through modes, reverse direction when Shift is held | +|`RGB_MODE_REVERSE` |`RGB_RMOD`|Cycle through modes in reverse, forward direction when Shift is held| +|`RGB_HUI` | |Increase hue | +|`RGB_HUD` | |Decrease hue | +|`RGB_SAI` | |Increase saturation | +|`RGB_SAD` | |Decrease saturation | +|`RGB_VAI` | |Increase value (brightness) | +|`RGB_VAD` | |Decrease value (brightness) | +|`RGB_MODE_PLAIN` |`RGB_M_P `|Static (no animation) mode | +|`RGB_MODE_BREATHE` |`RGB_M_B` |Breathing animation mode | +|`RGB_MODE_RAINBOW` |`RGB_M_R` |Rainbow animation mode | +|`RGB_MODE_SWIRL` |`RGB_M_SW`|Swirl animation mode | +|`RGB_MODE_SNAKE` |`RGB_M_SN`|Snake animation mode | +|`RGB_MODE_KNIGHT` |`RGB_M_K` |"Knight Rider" animation mode | +|`RGB_MODE_XMAS` |`RGB_M_X` |Christmas animation mode | +|`RGB_MODE_GRADIENT`|`RGB_M_G` |Static gradient animation mode | +|`RGB_MODE_RGBTEST` |`RGB_M_T` |Red, Green, Blue test animation mode | -You can change the behavior of the RGB Lighting by setting these configuration values. Use `#define