In config.h, we have to set the correct number of rows and columns. All we need to do is to copy the "onekey" example keyboard, and modify the config.h, keymap.c and matrix.c files to fit our keyboard. After a short search, I found the TMK Keyboard firmware, which is just perfect for our needs. Still not enough for the full layout, but should be fine for a tenkeyless keyboard. That gives us the largest matrix of 10×10, so 100 keys. Wait, what does it say about LEDs at the bottom there? Two more independent pins? Great, we only have to remove the two resistors and solder wires in their place, and we have 20 pins for our disposal. Even if we ditch the keypad, like I did in my keyboard, that only removes 17 keys. Hmm, that may be fine for those tiny, chocolate bar keyboards, but a modern PC keyboard has 105 keys. So, with 18 pins, the largest matrix we can get is a square 9×9. We add diodes, so that the pressed keys won't interfere with each other. Then we scan that repeatedly to figure out which ones are pressed. We basically make rows and columns, and put switches on the crossings. Can we somehow connect more keys? Turns out we can, by using a key matrix. Let's look at the pinout:Īccording to this diagram, we have 18 usable pins. Pro Micro can be had for about $4 in singles from the usual oriental sources. Arduino Leonardo is too big for our needs. There are three popular boards with that microcontroller: Arduino Leonardo, Teensy 2.0, and Pro Micro (not to be confused with Pro Mini, which uses ATmega328). That's mostly because it has hardware USB support, so you don't have to muck about with unreliable and hacky bit-banged VUSB. The ATmega32u4 microcontroller is an excellent choice for any HID device, such a mouse, a joystick or a keyboard. So you want to build your own keyboard (or keyboard-like device), but you are not sure what to use for the brains and how to connect and program it? I will describe what I came up with for the #Alpen Clack keyboard.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |