(Updated Sep 8) The circles animation is a keyboard RGB matrix animation designed to run on microcontrollers which don’t come with floating-point units (FPUs).
It simulates three circles (one red, one green, one blue) moving across the board and bouncing off of the edges. That part is relatively easy for any microcontroller; however, I wanted to see if it was feasible to simulate gravity as well.
To avoid floating-point operations, I had to redesign everything from the square-root algorithm (bitwise square root) to logarithms and inverses to support fixed-point numbers.
Here’s a video of the keyboard animation: https://youtu.be/lLubDZN-chE
Installation
Community modules are a recent addition to QMK, but luckily there’s extensive documentation at qmk.fm on how to install and integrate them. Follow these instructions to get the code on your machine. Then, you need to copy the LED-to-position map into script.py (there should be one in <keyboard_name>.c). All of the program configs go through this script, so if there’s anything you’re unhappy with, it can be easily changed.
Before compiling your keyboard layout, run:
python script.py
License
Apache-2.0