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:
* WS2811 and variants (WS2812, WS2812B, WS2812C, etc)
* SK6812RGBW
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.
## Selecting Colors
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.
#define RGB_DI_PIN D7 // The pin the LED strip is connected to
#define RGBLED_NUM 14 // Number of LEDs in your strip
```
### Optional Configuration
You can change the behavior of the RGB Lighting by setting these configuration values. Use `#define <Option> <Value>` in a `config.h` at the keyboard, revision, or keymap level.
| Option | Default Value | Description |
|--------|---------------|-------------|
| `RGBLIGHT_HUE_STEP` | 10 | How many hues you want to have available. |
| `RGBLIGHT_SAT_STEP` | 17 | How many steps of saturation you'd like. |
| `RGBLIGHT_VAL_STEP` | 17 | The number of levels of brightness you want. |
If you have `#define RGBLIGHT_ANIMATIONS` in your `config.h` you will have a number of animation modes you can cycle through using the `RGB_MOD` key. You can also `#define` other options to tweak certain animations.
| Option | Default Value | Description |
|--------|---------------|-------------|
| `RGBLIGHT_ANIMATIONS` | | `#define` this to enable animation modes. |
| `RGBLIGHT_EFFECT_KNIGHT_OFFSET` | 0 | Start the knight animation this many LEDs from the start of the strip. |
| `RGBLIGHT_EFFECT_KNIGHT_LED_NUM` | RGBLED_NUM | The number of LEDs to have the "knight" animation travel. |
| `RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL` | 1000 | How long to wait between light changes for the "christmas" animation. Specified in ms. |
| `RGBLIGHT_EFFECT_CHRISTMAS_STEP` | 2 | How many LED's to group the red/green colors by for the christmas mode. |
You can also tweak the behavior of the animations by defining these consts in your `keymap.c`. These mostly affect the speed different modes animate at.
```c
// How long (in ms) to wait between animation steps for the breathing mode
You can find a list of predefined colors at [`quantum/rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h). Free to add to this list!
![Planck with RGB Underglow](https://raw.githubusercontent.com/qmk/qmk_firmware/3774a7fcdab5544fc787f4c200be05fcd417e31f/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg)
Here is a quick demo on Youtube (with NPKC KC60) (https://www.youtube.com/watch?v=VKrpPAHlisY).
For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring the VCC, GND, and DI, you can enable the underglow in your Makefile.
RGBLIGHT_ENABLE = yes
In order to use the underglow animation functions, you need to have `#define RGBLIGHT_ANIMATIONS` in your `config.h`.
Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default:
#define RGB_DI_PIN F4 // The pin your RGB strip is wired to
#define RGBLED_NUM 14 // Number of LEDs
You'll need to edit `RGB_DI_PIN` to the pin you have your `DI` on your RGB strip wired to.