I’m currently working on the hardware part
Why TinyGo?
I chose TinyGo because it makes writing keyboard firmware actually fun. No more dealing with complex C code or fighting with the compiler. Just write simple Go code that does what you want. The code is easy to read and modify. Want to add RGB lights? Just add a few lines. Need an OLED screen? Same thing. TinyGo handles all the low-level stuff while keeping the code clean and fast. The RP2040 chip works great with TinyGo, and the binary size stays small. You get all the good parts of Go without the bloat. This is just my take on keyboard firmware - you can modify everything to work how you want. TinyGo makes it easy to experiment with new features and ideas.
Let’s start with some basics. How does a keyboard work?
A keyboard is pretty simple - it's just a bunch of switches that connect two points when you press them. But having one wire per key would be a mess, so we use something called a matrix.
The Matrix
Instead of wiring each key separately, we arrange them in rows and columns. Think of it like a grid - each key sits at the intersection of a row and column. When you press a key, it connects that row and column together.
For example, in a 4x4 matrix (16 keys), we only need 8 wires (4 rows + 4 columns) instead of 16 individual wires. Much better!
How We Read Keys
Here's how we check which keys are pressed:
1.
Set one row to HIGH voltage
2.
Check all the columns
3.
If a column reads HIGH, we know a key is pressed at that row/column intersection
4.
Move to the next row and repeat
This happens super fast - we scan the whole matrix many times per second. That's why it feels instant when you type.
Dealing with Issues
Sometimes keys can "ghost" or "block" - that's when the matrix gets confused about which keys are actually pressed. We handle this in the firmware with proper timing and debouncing (making sure a key is really pressed and not just electrical noise).
This is the basic idea behind the KEEBX firmware. The code is organized to make this scanning process clean and efficient, while being easy to modify for your needs.