hello gh, i have my custom keyboard with 40 WS2812B leds and 2 ec11 rotary encoders. i am running QMK and the keyboard is working great. i can toggle rgb modes using key combinations but what i wanted is to toggle rgb modes and/or colors using the 2 rotary encoders installed. so, my question is, how do i do this?
what i want for my keymap.c but does not work:
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(RGB_MOD);
} else {
tap_code(RGB_RMOD);
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code(RGB_HUI);
} else {
tap_code(RGB_HUD);
}
}
}
when i use the above keymap, i am getting this error:
QMK Firmware 0.7.44
WARNING: Some git submodules are out of date or modified.
Please consider running make git-submodule.
Making pabile/p42 with keymap default
avr-gcc (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Size before:
text data bss dec hex filename
0 22810 0 22810 591a .build/pabile_p42_default.hex
Compiling: keyboards/pabile/p42/keymaps/default/keymap.c In file included from quantum/keymap.h:44:0,
from quantum/quantum.h:30,
from keyboards/pabile/p42/p42.h:3,
from keyboards/pabile/p42/keymaps/default/keymap.c:1:
keyboards/pabile/p42/keymaps/default/keymap.c: In function ‘encoder_update_user’:
quantum/quantum_keycodes.h:648:17: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
#define RGB_MOD RGB_MODE_FORWARD
^
keyboards/pabile/p42/keymaps/default/keymap.c:34:16: note: in expansion of macro ‘RGB_MOD’
tap_code(RGB_MOD); /*mouse wheel down */
^
cc1: all warnings being treated as errors
[ERRORS]
|
|
|
tmk_core/rules.mk:383: recipe for target '.build/obj_pabile_p42_default/keyboards/pabile/p42/keymaps/default/keymap.o' failed
make[1]: *** [.build/obj_pabile_p42_default/keyboards/pabile/p42/keymaps/default/keymap.o] Error 1
Make finished with errors
Makefile:563: recipe for target 'pabile/p42:default' failed
make: *** [pabile/p42:default] Error 1
my config.h looks like this:
#define RGB_DI_PIN B0
#define RGBLIGHT_SLEEP
#define RGBLED_NUM 40
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_LIMIT_VAL 40
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_LED_MAP { 0,1,2,3,4,5,6,7,8,9,19,18,17,16,15,14,13,12,11,10,20,21,22,23,24,25,26,27,28,29,39,38,37,36,35,34,33,32,31,30}