Firmware: Add support for rotary encoder
This commit is contained in:
parent
1a0e0c11c1
commit
79560566a1
|
|
@ -178,7 +178,6 @@ pcbs:
|
|||
params:
|
||||
from: "{{colrow}}"
|
||||
to: "{{row_net}}"
|
||||
# TODO: Check whether these pins are correct (should C really be GND?)
|
||||
A: P3
|
||||
B: P4
|
||||
C: GND
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
"features": {
|
||||
"bootmagic": true,
|
||||
"command": false,
|
||||
"console": false,
|
||||
"console": true,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true,
|
||||
|
|
@ -55,6 +55,14 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"encoder": {
|
||||
"rotary": [
|
||||
{
|
||||
"pin_a": "D0",
|
||||
"pin_b": "D4"
|
||||
}
|
||||
]
|
||||
},
|
||||
"rgb_matrix": {
|
||||
"driver": "ws2812",
|
||||
"default": {
|
||||
|
|
|
|||
|
|
@ -28,10 +28,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
|
||||
// Keyboard control layer for entering bootloader and controlling the RGB light (hold 0,4)
|
||||
[1] = LAYOUT_ortho_5x5(
|
||||
QK_BOOTLOADER, QK_REBOOT, _______, _______, QK_CLEAR_EEPROM,
|
||||
QK_BOOTLOADER, QK_REBOOT, QK_DEBUG_TOGGLE, _______, QK_CLEAR_EEPROM,
|
||||
RGB_TOG, RGB_MODE_REVERSE, RGB_MODE_FORWARD, _______, _______,
|
||||
RGB_VAI, RGB_SAI, RGB_HUI, RGB_SPI, _______,
|
||||
RGB_VAD, RGB_SAD, RGB_HUD, RGB_SPD, _______,
|
||||
RGB_MODE_PLAIN, RGB_MODE_BREATHE, RGB_MODE_RAINBOW, RGB_MODE_SWIRL, _______
|
||||
),
|
||||
};
|
||||
|
||||
// Define mapping for rotary encoder
|
||||
#if defined(ENCODER_MAP_ENABLE)
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
||||
// Default layer: Emulate scroll wheel
|
||||
[0] = {
|
||||
ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN)
|
||||
},
|
||||
|
||||
// Keyboard control layer: Control RGB LED brightness
|
||||
[1] = {
|
||||
ENCODER_CCW_CW(RGB_VAD, RGB_VAI)
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,2 +1,6 @@
|
|||
# Enable support for rotary encoder
|
||||
ENCODER_ENABLE = yes
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
|
||||
# Add custom RGB LED effects
|
||||
RGB_MATRIX_CUSTOM_USER = yes
|
||||
|
|
|
|||
Loading…
Reference in New Issue