├── config.h ├── rules.mk ├── README.md └── keymap.c /config.h: -------------------------------------------------------------------------------- 1 | /* 2 | This is the c configuration file for the keymap 3 | 4 | Copyright 2012 Jun Wako 5 | Copyright 2015 Jack Humbert 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 2 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | */ 20 | 21 | #pragma once 22 | 23 | /* Select hand configuration */ 24 | 25 | #define MASTER_LEFT 26 | // #define MASTER_RIGHT 27 | // #define EE_HANDS 28 | #define SPLIT_WPM_ENABLE 29 | #define TAPPING_FORCE_HOLD 30 | #define TAPPING_TERM 100 -------------------------------------------------------------------------------- /rules.mk: -------------------------------------------------------------------------------- 1 | # Build Options 2 | # change to "no" to disable the options, or define them in the Makefile in 3 | # the appropriate keymap folder that will get included automatically 4 | # 5 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite 6 | MOUSEKEY_ENABLE = no # Mouse keys 7 | EXTRAKEY_ENABLE = no # Audio control and System control 8 | CONSOLE_ENABLE = no # Console for debug 9 | COMMAND_ENABLE = no # Commands for debug and configuration 10 | NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 11 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality 12 | AUDIO_ENABLE = no # Audio output 13 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. 14 | SWAP_HANDS_ENABLE = no # Enable one-hand typing 15 | OLED_ENABLE = yes # OLED display 16 | WPM_ENABLE = yes 17 | 18 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 19 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 20 | 21 | # If you want to change the display of OLED, you need to change here 22 | SRC += ./lib/rgb_state_reader.c \ 23 | ./lib/layer_state_reader.c \ 24 | ./lib/logo_reader.c \ 25 | ./lib/keylogger.c \ 26 | # ./lib/mode_icon_reader.c \ 27 | # ./lib/host_led_state_reader.c \ 28 | # ./lib/timelogger.c \ 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lily58 BongoCat + WPM + Layer Indicator 2 | 3 | This is a combination of the default Lily58 layout / configs / etc combined with https://github.com/jordi-7/qmk_firmware/tree/master/keyboards/lily58/keymaps/jgr. 4 | 5 | I could not get their version working, but managed to adapt their code in with a default layout to eventually achieve a working product. 6 | 7 | This SHOULD compile and run with no issues assuming: 8 | 9 | * Lily58 Pro 10 | * Using Arduino Pro Micro (or clone) for microcontrollers 11 | * No RGB or underglow of any kind 12 | * Left-side as `master` 13 | 14 | # What does this do? 15 | 16 | `keymap.c` in a previous commit used the original layout -- utilize that if desired. The latest commit in this repository has a customized RAISE layer (specifically the NAV cluster on the right side) -- if this is undesireable, please use an older commit with the original layout or alter the layout yourself in a fork! 17 | 18 | This keymap adds text to the left OLED to show your current estimated WPM, as well as what layer you are on. 19 | 20 | This keymap adds a Bongo Cat animation loop on the right OLED: 21 | 22 | * At below 30WPM, Bongo Cat idles. 23 | * At 30 WPM, Bongo Cat raises its arms... 24 | * At 40+ WPM, Bongo Cat hits the table in a looping animation. 25 | 26 | *Please note that the "WPM" counter is more for fun than for getting realistic WPM numbers from.* 27 | 28 | # Future Improvements 29 | 30 | Currently the left OLED falls asleep on its own, and the timeout does not match that of the right side. An end goal would be to have these sides sleep together and wake together. 31 | -------------------------------------------------------------------------------- /keymap.c: -------------------------------------------------------------------------------- 1 | #include QMK_KEYBOARD_H 2 | #include 3 | 4 | // OLED setup 5 | #define IDLE_FRAMES 5 6 | #define IDLE_SPEED 30 7 | #define TAP_FRAMES 2 8 | #define TAP_SPEED 40 9 | #define ANIM_FRAME_DURATION 200 10 | #define ANIM_SIZE 512 11 | 12 | bool gui_on = true; 13 | char wpm_str[10]; 14 | uint32_t anim_timer = 0; 15 | uint32_t anim_sleep = 0; 16 | uint8_t current_idle_frame = 0; 17 | uint8_t current_tap_frame = 0; 18 | 19 | static long int oled_timeout = 600000; // 10 minutes 20 | 21 | enum layer_number { 22 | _QWERTY = 0, 23 | _LOWER, 24 | _RAISE, 25 | _ADJUST, 26 | }; 27 | 28 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 29 | 30 | /* QWERTY 31 | * ,-----------------------------------------. ,-----------------------------------------. 32 | * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | 33 | * |------+------+------+------+------+------| |------+------+------+------+------+------| 34 | * | Tab | Q | W | E | R | T | | Y | U | I | O | P | - | 35 | * |------+------+------+------+------+------| |------+------+------+------+------+------| 36 | * |LCTRL | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' | 37 | * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| 38 | * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| 39 | * `-----------------------------------------/ / \ \-----------------------------------------' 40 | * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | 41 | * | | | |/ / \ \ | | | | 42 | * `----------------------------' '------''--------------------' 43 | */ 44 | 45 | [_QWERTY] = LAYOUT( \ 46 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, \ 47 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ 48 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ 49 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ 50 | KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, KC_ENT, MO(_RAISE), KC_BSPC, KC_RGUI \ 51 | ), 52 | /* LOWER 53 | * ,-----------------------------------------. ,-----------------------------------------. 54 | * | | | | | | | | | | | | | | 55 | * |------+------+------+------+------+------| |------+------+------+------+------+------| 56 | * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | 57 | * |------+------+------+------+------+------| |------+------+------+------+------+------| 58 | * | ` | ! | @ | # | $ | % |-------. ,-------| ^ | & | * | ( | ) | - | 59 | * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| 60 | * | | | | | | |-------| |-------| | _ | + | { | } | | | 61 | * `-----------------------------------------/ / \ \-----------------------------------------' 62 | * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | 63 | * | | | |/ / \ \ | | | | 64 | * `----------------------------' '------''--------------------' 65 | */ 66 | [_LOWER] = LAYOUT( \ 67 | _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______,\ 68 | KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ 69 | KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TILD, \ 70 | _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ 71 | _______, _______, _______, _______, _______, _______, _______, _______\ 72 | ), 73 | /* RAISE 74 | * ,-----------------------------------------. ,-----------------------------------------. 75 | * | | | | | | | | | | | | | DEL | 76 | * |------+------+------+------+------+------| |------+------+------+------+------+------| 77 | * | ` | 1 | 2 | 3 | 4 | 5 | | | HOME | PGDN | PGUP | END | INS | 78 | * |------+------+------+------+------+------| |------+------+------+------+------+------| 79 | * | F1 | F2 | F3 | F4 | F5 | F6 |-------. ,-------| | Left | Down | Up | Right| | 80 | * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| 81 | * | F7 | F8 | F9 | F10 | F11 | F12 |-------| |-------| + | - | = | [ | ] | \ | 82 | * `-----------------------------------------/ / \ \-----------------------------------------' 83 | * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | 84 | * | | | |/ / \ \ | | | | 85 | * `----------------------------' '------''--------------------' 86 | */ 87 | 88 | [_RAISE] = LAYOUT( \ 89 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ 90 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS, \ 91 | KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, \ 92 | KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PLUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ 93 | _______, _______, _______, _______, _______, _______, _______, _______ \ 94 | ), 95 | /* ADJUST 96 | * ,-----------------------------------------. ,-----------------------------------------. 97 | * | | | | | | | | | | | | | | 98 | * |------+------+------+------+------+------| |------+------+------+------+------+------| 99 | * | | | | | | | | | | | | | | 100 | * |------+------+------+------+------+------| |------+------+------+------+------+------| 101 | * | | | | | | |-------. ,-------| | |RGB ON| HUE+ | SAT+ | VAL+ | 102 | * |------+------+------+------+------+------| | | |------+------+------+------+------+------| 103 | * | | | | | | |-------| |-------| | | MODE | HUE- | SAT- | VAL- | 104 | * `-----------------------------------------/ / \ \-----------------------------------------' 105 | * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | 106 | * | | | |/ / \ \ | | | | 107 | * `----------------------------' '------''--------------------' 108 | */ 109 | [_ADJUST] = LAYOUT( \ 110 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ 111 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ 112 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ 113 | XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\ 114 | _______, _______, _______, _______, _______, _______, _______, _______ \ 115 | ) 116 | }; 117 | 118 | layer_state_t layer_state_set_user(layer_state_t state) { 119 | return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); 120 | } 121 | 122 | //bool process_record_user(uint16_t keycode, keyrecord_t *record) { 123 | // if (record->event.pressed) { 124 | //#ifdef OLED_ENABLE 125 | // set_keylog(keycode, record); 126 | //#endif 127 | // // set_timelog(); 128 | // } 129 | // return true; 130 | //} 131 | 132 | // 133 | // Rotate OLED display 134 | // 135 | oled_rotation_t oled_init_user(oled_rotation_t rotation) { 136 | if (!is_keyboard_master()) return OLED_ROTATION_180; 137 | else return rotation; 138 | } 139 | 140 | // 141 | // Render left OLED display 142 | // 143 | static void render_status(void) { 144 | 145 | // WPM 146 | oled_write_P(PSTR(" "), false); 147 | sprintf(wpm_str, "%03d", get_current_wpm()); 148 | oled_write(wpm_str, false); 149 | oled_write_P(PSTR(" WPM"), false); 150 | 151 | // GUI keys indicator 152 | if (gui_on) oled_write_P(PSTR("\n "), false); 153 | else oled_write_P(PSTR("\n GUI OFF"), false); 154 | 155 | // Caps lock indicator 156 | led_t led_state = host_keyboard_led_state(); 157 | oled_write_P(led_state.caps_lock ? PSTR("\n CAPS LOCK") : PSTR("\n "), false); 158 | 159 | // Layer indicator 160 | oled_write_P(PSTR("\n LAYER "), false); 161 | 162 | switch (get_highest_layer(layer_state)) { 163 | case 2: 164 | oled_write_P(PSTR("RAISE"), false); 165 | break; 166 | // Layer 1 167 | case 1: 168 | oled_write_P(PSTR("LOWER"), false); 169 | break; 170 | // Layer 0 171 | default: 172 | oled_write_P(PSTR("BASE "), false); 173 | break; 174 | } 175 | } 176 | 177 | // 178 | // Render right OLED display animation 179 | // 180 | static void render_anim(void) { 181 | 182 | // Idle animation 183 | static const char PROGMEM idle[IDLE_FRAMES][ANIM_SIZE] = { 184 | 185 | { 186 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,64,32,32,32,32,16,16,16,16,16,8,8,4,4,4,8,48,64,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,100,130,2,2,2,2,2,1,0,0,0,0,128,128,0,0,0,0,0,0,0,0,0,128,0,48,48,0,192,193,193,194,4,8,16,32,64,128,0,0,0,128,128,128,128,64,64, 187 | 64,64,32,32,32,32,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,56,4,3,0,0,0,0,0,0,0,12,12,12,13,1,0,64,160,33,34,18,17,17,17,9,8,8,8,8,4,4,8,8,16,16,16,16,16,17,15,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,64,64,64,64,64,32,32,32,32,32,16,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,3,2,2,1,1,1,1,1,1,2,2,4,4,8,8,8,8,8,7, 188 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 189 | }, 190 | 191 | { 192 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,64,32,32,32,32,16,16,16,16,16,8,8,4,4,4,8,48,64,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,100,130,2,2,2,2,2,1,0,0,0,0,128,128,0,0,0,0,0,0,0,0,0,128,0,48,48,0,192,193,193,194,4,8,16,32,64,128,0,0,0,128,128,128,128,64,64, 193 | 64,64,32,32,32,32,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,56,4,3,0,0,0,0,0,0,0,12,12,12,13,1,0,64,160,33,34,18,17,17,17,9,8,8,8,8,4,4,8,8,16,16,16,16,16,17,15,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,64,64,64,64,64,32,32,32,32,32,16,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,3,2,2,1,1,1,1,1,1,2,2,4,4,8,8,8,8,8, 194 | 7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 195 | }, 196 | 197 | { 198 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,64,64,64,64,32,32,32,32,16,8,4,2,2,4,24,96,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,194,1,1,2,2,4,4,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,96,0,129,130,130,132,8,16,32,64,128,0,0,0,0,128,128,128,128,64,64,64,64,32, 199 | 32,32,32,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,112,25,6,0,0,0,0,0,0,0,24,24,24,27,3,0,64,160,34,36,20,18,18,18,11,8,8,8,8,5,5,9,9,16,16,16,16,16,17,15,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,64,64,64,64,64,32,32,32,32,32,16,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,3,2,2,1,1,1,1,1,1,2,2,4,4,8,8,8,8,8,7,0,0,0, 200 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 201 | }, 202 | 203 | { 204 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,0,0,0,0,0,128,64,64,32,32,32,32,16,16,16,16,8,4,2,1,1,2,12,48,64,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,225,0,0,1,1,2,2,1,0,0,0,0,128,128,0,0,0,0,0,0,0,0,0,128,0,48,48,0,192,193,193,194,4,8,16,32,64,128,0,0,0,128,128,128,128,64,64, 205 | 64,64,32,32,32,32,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,112,12,3,0,0,0,0,0,0,0,12,12,12,13,1,0,64,160,33,34,18,17,17,17,9,8,8,8,8,4,4,8,8,16,16,16,16,16,17,15,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,64,64,64,64,64,32,32,32,32,32,16,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,3,2,2,1,1,1,1,1,1,2,2,4,4,8,8,8,8,8, 206 | 7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 207 | }, 208 | 209 | { 210 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,64,64,32,32,32,32,16,16,16,16,8,8,4,2,2,2,4,56,64,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,226,1,1,2,2,2,2,1,0,0,0,0,128,128,0,0,0,0,0,0,0,0,0,128,0,48,48,0,192,193,193,194,4,8,16,32,64,128,0,0,0,128,128,128,128,64,64,64,64, 211 | 32,32,32,32,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,112,12,3,0,0,0,0,0,0,0,12,12,12,13,1,0,64,160,33,34,18,17,17,17,9,8,8,8,8,4,4,8,8,16,16,16,16,16,17,15,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,64,64,64,64,64,32,32,32,32,32,16,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,3,2,2,1,1,1,1,1,1,2,2,4,4,8,8,8,8,8,7,0,0, 212 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 213 | } 214 | 215 | }; 216 | 217 | // Prep animation 218 | static const char PROGMEM prep[][ANIM_SIZE] = { 219 | 220 | { 221 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,0,0,0,0,0,128,64,64,32,32,32,32,16,16,16,16,8,4,2,1,1,2,12,48,64,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,225,0,0,1,1,2,2,129,128,128,0,0,128,128,0,0,0,0,0,0,0,0,0,128,0,48,48,0,0,1,225,26,6,9,49,53,1,138,124,0,0,128,128,128,128,64,64, 222 | 64,64,32,32,32,32,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,112,12,3,0,0,24,6,5,152,153,132,195,124,65,65,64,64,32,33,34,18,17,17,17,9,8,8,8,8,4,4,4,4,4,4,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,64,64,64,64,64,32,32,32,32,32,16,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,3,2,2,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0, 223 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 224 | } 225 | 226 | }; 227 | 228 | // Typing animation 229 | static const char PROGMEM tap[TAP_FRAMES][ANIM_SIZE] = { 230 | 231 | { 232 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,0,0,0,0,0,128,64,64,32,32,32,32,16,16,16,16,8,4,2,1,1,2,12,48,64,128,0,0,0,0,0,0,0,248,248,248,248,0,0,0,0,0,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,225,0,0,1,1,2,2,129,128,128,0,0,128,128,0,0,0,0,0,0,0,0,0,128,0,48,48,0,0,1,1,2,4,8,16,32,67,135,7,1,0,184,188,190,159, 233 | 95,95,79,76,32,32,32,32,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,112,12,3,0,0,24,6,5,152,153,132,67,124,65,65,64,64,32,33,34,18,17,17,17,9,8,8,8,8,4,4,8,8,16,16,16,16,16,17,15,1,61,124,252,252,252,252,252,60,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,64,64,64,64,64,32,32,32,32,32,16,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,3,2,2,1,1,1, 234 | 1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 235 | }, 236 | 237 | { 238 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,0,0,0,0,0,128,64,64,32,32,32,32,16,16,16,16,8,4,2,1,1,2,12,48,64,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,225,0,0,1,1,2,2,1,0,0,0,0,128,128,0,0,0,0,0,0,0,0,0,128,0,48,48,0,0,1,225,26,6,9,49,53,1,138,124,0,0,128,128,128,128,64,64,64,64,32, 239 | 32,32,32,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,112,12,3,0,0,0,0,0,0,0,0,0,0,1,1,0,64,160,33,34,18,17,17,17,9,8,8,8,8,4,4,4,4,4,4,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,128,128,128,64,64,64,64,64,32,32,32,32,32,16,16,16,16,16,8,8,8,8,8,4,4,4,4,4,2,3,122,122,121,121,121,121,57,49,2,2,4,4,8,8,8,136,136,135,128, 240 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 241 | } 242 | 243 | }; 244 | 245 | void animation_phase(void) { 246 | 247 | if (get_current_wpm() <=IDLE_SPEED) { 248 | current_idle_frame = (current_idle_frame + 1) % IDLE_FRAMES; 249 | oled_write_raw_P(idle[abs((IDLE_FRAMES-1)-current_idle_frame)], ANIM_SIZE); 250 | } 251 | 252 | if (get_current_wpm() >IDLE_SPEED && get_current_wpm() =TAP_SPEED) { 257 | current_tap_frame = (current_tap_frame + 1) % TAP_FRAMES; 258 | oled_write_raw_P(tap[abs((TAP_FRAMES-1)-current_tap_frame)], ANIM_SIZE); 259 | } 260 | } 261 | 262 | if (get_current_wpm() != 000) { 263 | oled_on(); 264 | 265 | if (timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) { 266 | anim_timer = timer_read32(); 267 | animation_phase(); 268 | } 269 | 270 | anim_sleep = timer_read32(); 271 | } else { 272 | if (timer_elapsed32(anim_sleep) > oled_timeout) { 273 | oled_off(); 274 | } else { 275 | if (timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) { 276 | anim_timer = timer_read32(); 277 | animation_phase(); 278 | } 279 | } 280 | } 281 | } 282 | 283 | // 284 | // OLED display rendering 285 | // 286 | bool oled_task_user(void) { 287 | if (is_keyboard_master()) { 288 | // Left side 289 | render_status(); 290 | } else { 291 | // Right side 292 | render_anim(); 293 | } 294 | 295 | return 0; 296 | } 297 | --------------------------------------------------------------------------------