diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2019-06-17 08:46:08 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2019-06-17 08:46:08 +0200 |
commit | 482e83cc7e6512d58e8fb30ebc661bb640d2fd67 (patch) | |
tree | 35bf574bd332e66f251235486c4693b164497340 | |
parent | 2dd1cb3e5380afd2c48d121bd341ace5fe5a7554 (diff) |
RGB lighting and usernames
-rw-r--r-- | keyboards/ergodox_ez/keymaps/jworthe/config.h | 3 | ||||
-rw-r--r-- | keyboards/ergodox_ez/keymaps/jworthe/keymap.c | 30 | ||||
-rw-r--r-- | quantum/rgb_matrix_animations/digital_rain_anim.h | 32 |
3 files changed, 39 insertions, 26 deletions
diff --git a/keyboards/ergodox_ez/keymaps/jworthe/config.h b/keyboards/ergodox_ez/keymaps/jworthe/config.h index 23ae36c89f..643920d464 100644 --- a/keyboards/ergodox_ez/keymaps/jworthe/config.h +++ b/keyboards/ergodox_ez/keymaps/jworthe/config.h @@ -59,6 +59,8 @@ #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 255 #define RGBLIGHT_VAL_STEP 12 +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// #define RGB_MATRIX_KEYPRESSES /* fix space cadet rollover issue */ #define DISABLE_SPACE_CADET_ROLLOVER @@ -119,5 +121,4 @@ //#define NO_ACTION_FUNCTION //#define DEBUG_MATRIX_SCAN_RATE - #endif diff --git a/keyboards/ergodox_ez/keymaps/jworthe/keymap.c b/keyboards/ergodox_ez/keymaps/jworthe/keymap.c index 001e6822f3..a4a2a5cd84 100644 --- a/keyboards/ergodox_ez/keymaps/jworthe/keymap.c +++ b/keyboards/ergodox_ez/keymaps/jworthe/keymap.c @@ -12,6 +12,9 @@ enum custom_keycodes { EMAIL1 = SAFE_RANGE, EMAIL2, EMAIL3, + NAME1, + NAME2, + NAME3, TESTPW, KINDRG }; @@ -28,6 +31,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case EMAIL3: SEND_STRING("justin@jemstep.com"); return false; + case NAME1: + SEND_STRING("justin"); + return false; + case NAME2: + SEND_STRING("justin.worthe"); + return false; + case NAME3: + SEND_STRING("wernijc"); + return false; case TESTPW: SEND_STRING("1qaz!QAZ"); return false; @@ -44,13 +56,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [BASE] = LAYOUT_ergodox_pretty( -KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, TT(TEXT), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, +KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, TT(TEXT), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_Q, KC_W, KC_E, KC_R, KC_T, TT(SYMB), TT(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, -MO(SYMB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, +MO(SYMB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(SYMB), MO(MDIA), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, -KC_LCTRL, KC_LGUI, KC_LALT, MO(SYMB), KC_NO, KC_NO, KC_NO, KC_RALT, KC_RGUI, KC_RCTRL, +KC_LCTL, KC_LGUI, KC_LALT, MO(SYMB), KC_NO, KC_NO, KC_NO, KC_RALT, KC_RGUI, KC_RCTL, - KC_DELT, KC_EQL, KC_LEFT, KC_RIGHT, + KC_DEL, KC_EQL, KC_LEFT, KC_RGHT, KC_LBRC, KC_UP, KC_SPC, KC_BSPC, KC_RBRC, KC_DOWN, KC_TAB, KC_ENT @@ -95,11 +107,11 @@ _______, _______, _______, _______, _______, [TEXT] = LAYOUT_ergodox_pretty( - _______, EMAIL1, EMAIL2, EMAIL3, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, TESTPW, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KINDRG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, EMAIL1, EMAIL2, EMAIL3, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, + _______, TESTPW, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, + _______, NAME1, NAME2, NAME3, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KINDRG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, + _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, _______, _______, _______, _______, _______, _______, diff --git a/quantum/rgb_matrix_animations/digital_rain_anim.h b/quantum/rgb_matrix_animations/digital_rain_anim.h index 6ccba392aa..d837031ae9 100644 --- a/quantum/rgb_matrix_animations/digital_rain_anim.h +++ b/quantum/rgb_matrix_animations/digital_rain_anim.h @@ -3,14 +3,14 @@ #ifndef RGB_DIGITAL_RAIN_DROPS // lower the number for denser effect/wider keyboard - #define RGB_DIGITAL_RAIN_DROPS 24 + #define RGB_DIGITAL_RAIN_DROPS 10 #endif extern uint8_t rgb_frame_buffer[MATRIX_ROWS][MATRIX_COLS]; bool rgb_matrix_digital_rain(effect_params_t* params) { // algorithm ported from https://github.com/tremby/Kaleidoscope-LEDEffect-DigitalRain - const uint8_t drop_ticks = 28; + const uint8_t drop_ticks = 14; const uint8_t pure_green_intensity = 0xd0; const uint8_t max_brightness_boost = 0xc0; const uint8_t max_intensity = 0xff; @@ -25,14 +25,14 @@ bool rgb_matrix_digital_rain(effect_params_t* params) { for (uint8_t col = 0; col < MATRIX_COLS; col++) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - if (row == 0 && drop == 0 && rand() < RAND_MAX / RGB_DIGITAL_RAIN_DROPS) { + if (col == 0 && drop == 0 && rand() < RAND_MAX / RGB_DIGITAL_RAIN_DROPS) { // top row, pixels have just fallen and we're // making a new rain drop in this column - rgb_frame_buffer[col][row] = max_intensity; + rgb_frame_buffer[row][col] = max_intensity; } - else if (rgb_frame_buffer[col][row] > 0 && rgb_frame_buffer[col][row] < max_intensity) { + else if (rgb_frame_buffer[row][col] > 0 && rgb_frame_buffer[row][col] < max_intensity) { // neither fully bright nor dark, decay it - rgb_frame_buffer[col][row]--; + rgb_frame_buffer[row][col]--; } // set the pixel colour uint8_t led[LED_HITS_TO_REMEMBER]; @@ -40,12 +40,12 @@ bool rgb_matrix_digital_rain(effect_params_t* params) { // TODO: multiple leds are supported mapped to the same row/column if (led_count > 0) { - if (rgb_frame_buffer[col][row] > pure_green_intensity) { - const uint8_t boost = (uint8_t) ((uint16_t) max_brightness_boost * (rgb_frame_buffer[col][row] - pure_green_intensity) / (max_intensity - pure_green_intensity)); + if (rgb_frame_buffer[row][col] > pure_green_intensity) { + const uint8_t boost = (uint8_t) ((uint16_t) max_brightness_boost * (rgb_frame_buffer[row][col] - pure_green_intensity) / (max_intensity - pure_green_intensity)); rgb_matrix_set_color(led[0], boost, max_intensity, boost); } else { - const uint8_t green = (uint8_t) ((uint16_t) max_intensity * rgb_frame_buffer[col][row] / pure_green_intensity); + const uint8_t green = (uint8_t) ((uint16_t) max_intensity * rgb_frame_buffer[row][col] / pure_green_intensity); rgb_matrix_set_color(led[0], 0, green, 0); } } @@ -55,18 +55,18 @@ bool rgb_matrix_digital_rain(effect_params_t* params) { if (++drop > drop_ticks) { // reset drop timer drop = 0; - for (uint8_t row = MATRIX_ROWS - 1; row > 0; row--) { - for (uint8_t col = 0; col < MATRIX_COLS; col++) { + for (uint8_t col = MATRIX_COLS - 1; col > 0; col--) { + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { // if ths is on the bottom row and bright allow decay - if (row == MATRIX_ROWS - 1 && rgb_frame_buffer[col][row] == max_intensity) { - rgb_frame_buffer[col][row]--; + if (col == MATRIX_COLS - 1 && rgb_frame_buffer[row][col] == max_intensity) { + rgb_frame_buffer[row][col]--; } // check if the pixel above is bright - if (rgb_frame_buffer[col][row - 1] == max_intensity) { + if (rgb_frame_buffer[row][col-1] == max_intensity) { // allow old bright pixel to decay - rgb_frame_buffer[col][row - 1]--; + rgb_frame_buffer[row][col-1]--; // make this pixel bright - rgb_frame_buffer[col][row] = max_intensity; + rgb_frame_buffer[row][col] = max_intensity; } } } |