OLED animations for QMK
This repository contains some animations for QMK keyboard firmware.
They are tested on my Corne Keyboard build, but should work just fine on any other with 128x32 OLED display (Lily58, Sofle, etc.).
You can preview all animations on Demo page
To use any of these you need to be building your firmware locally. Follow steps from here if you don't do it already: Setting Up Your QMK Environment
You need to have OLED driver enabled in your firmware, usually you also need to enable
WPM counter in QMK so animation knows how fast you are typing. Just put these in your rules.mk
file:
WPM_ENABLE = yes # Enable word per minute counter
LTO_ENABLE = yes # Makes hex file smaller
OLED_ENABLE = yes # Enable OLEDsLTO_ENABLE is not really required, but animations take a lot of space and it makes firmware smaller. Otherwise you might not be able to flash your controller. Usually you will need this if you're on ATMega/Pro Micro controllers. On STM chips theres plenty of free flash memory, so you might just skip it.
All animations assume you're using vertically mounted OLED (like in Corne). In the header of the animation file there will be a suggested rotation option to set in your keymap.c file. It should be enough to just put something like this at the beggining:
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (!is_keyboard_master()) {
return OLED_ROTATION_180;
}
return rotation;
}
#endifThis will play animation only on secondary half of the keyboard. Adjust to your needs.
Just copy all animation .c files to your keymap folder, include selected one at the top and use inside keymap.c:
…Again, this assumes you have a split keyboard and want to display animation on the secondary half. Adjust to your keyboard.
If you want to leave the standard Corne logo on another part, you will need to use this function, and call it inside the oled_user_task.
void oled_render_logo(void) {
static const char PROGMEM crkbd_logo[] = {
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94,
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
0};
oled_write_P(crkbd_logo, false);
}bool oled_task_user(void) {
if (!is_keyboard_master()) {
oled_render_anim();
} else {
oled_render_logo();
}
return false;
}For example:
make crkbd:marek:flashwhere “marek” is your folder inside the keyboard keymaps folder.
Animations take a lot of memory on the microcontroller. What you can do to still make it work, is to disable backlight LED animations.
If you don't need them at all, just disable everything in rules.mk
RGBLIGHT_ENABLE = noIf you want to keep some simple LED backlight you can also try to disable most of them. Here's what worked for me:
Open config.h file in your keymap and:
#define RGBLIGHT_ANIMATIONS…This will still leave you few simple LED effects and free quite a lot of memory.
You can also comment out the WPM render function if you don’t need it.
If you like this, maybe you'll also like some other stuff I'm working on:
No open issues yet, or sync has not completed.