Pi Pico + KMK = the perfect combo for Custom Keyboards

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign [Music] I built quite a few keyboards from scratch now and one thing that still annoys me is compiling firmware you see the software part that powers every keyboard is compiled into a binary or hex file that's also called firmware this file then gets flashed onto the microcontroller but once it's compiled you can read the configuration used in the file anymore for that you need to look into the source files that you use to compile it and to edit the keyboard configuration from another computer you now need a syncing or Version Control tool like git as well as the entire build environment used for compiling this can be overwhelming quite fast especially for people that don't work with the common line every day my name is Jan long and I'm a software developer and I like to build keyboards for fun but also I don't need any more overhead when building my custom boards this is where the pi Pico comes into play all other keyboards I build used either the pro micro or a Teensy microcontroller with qmk qmk is a keyboard firmware written in C with plenty of features for all your custom keyboard needs like split keyboard support RGB lighting effects tap and hold modifiers rotary encoders layered key maps and many more I already did a video about how to set up qmk and compile a simple firmware for a macro pad this time as the pi Pico supports circuit python we can use kmk and the best part is the entire setup is just drag and drop so this is the pi Pico I have both the headerless version and the one with pin headers attached this is quite nice for prototyping if I can just wire wrap the wires around the pins both of them have 26 i o pins with which three are analog so you can do quite a lot of things and actually I used this to build full size keyboards so the last time I did the w65 I noticed that the pins required were really tight for a 65 board and anything bigger needed a different microcontroller with this one I have more Headroom for the size of keyboards I want to build there's also separate chips that have a USBC connector instead of micro USB I'll want to try those in the future but these are the official Raspberry Pi Picos so I wanted to have them try it first here you can pretty clearly see the boot select button on the side that you use to switch which mode it boots in either your program or to flash new firmware on it every time you unplug this and then plug it back into your PC it will run the program that's stored on it and in this case this is how we update our firmware so when you change keyboard files for the layout you can just reconnect it and it should run your updated keymap the nice thing with this is that the pins are actually all labeled so there's not much guessing involved because you can just see what to connect to which piece really helpful so as you can see the pro micro is quite a bit smaller but also we have way more pins on the pi Pico which is insanely nice otherwise they fit quite nicely into this macro pad as always you can find the 3D print files for this thing in the description below and this one now also includes this top cap let me see if I can pull it off so you can have a separate label piece that you can insert in here or switch between your separate micro pads before we go any deeper let me just show you how simple it is to set it up trust me it won't take long first we download the circuit python uf2 file then we connect the pi picot to the computer while holding down the boot select button for me this also worked without holding down boot select for the first time while nothing was installed on the pipe Eco before now just drag the file on the pi Pico flash drive that appeared after that the pipico will have circuit python installed note on OS X Ventura the finder has a bug with writing to the pi Pico in this mode so until Apple fixes this we just need to copy this over with the terminal command I pasted that in the description below next thing is to download the actual kmk firmware which we get from GitHub here we just grabbed the entire kmk folder from the zip file and move it to the Circuit python Drive and yes you just need to set this up once or whenever you need to update kmk or the circuit python firmware here is the magic part about this we just need a code.py python file for this drive to make our keyboard work and the simplest version of this for working macro pad is just a few lines of code it's just defining the pins on the keyboard Matrix and the keys you want to use on your keymap all this requires no special setup on your computer so you can change things wherever you are with your keyboard a cool side effect of this is that you can now also read the current keyboard configuration from the keyboard and of course I was also wondering how I can hide the drive when I don't want to change the keyboard configuration turns out this is pretty simple as well we can just place a boot.py python file that will only Mount the drive when the pi Pico has a switch pressed when connecting it this can also be one of the keys on the keyboard seeing how simple the handling of the firmware is for this I'm already thinking about reply placing the microcontroller in a few of my keyboards specifically I still need to rebuild the w65 Mostly because of the switches have some issue and for some reason that's not even because of the wiring but also because there is no via support for the team CLC at least not in a simple way speaking of video or vial support kmk does not have VR file support currently and no official replacement for it as well so to update the key map from the PC we currently need to edit the keyboard configuration file I know most people will say this is simple enough to just edit the python file with whatever key you want to change but I do like to use a GUI instead of typing out the names of the keys that I need to look up from like a key code list online I already have seen a simple solution for this but I haven't seen the source code implementation details yet from what I've read you can either write to the drive when it's mounted on the PC or from the microcontroller itself but not at the same time so theoretically it should be possible to use a GUI application to change these key maps while still allowing the files to be changed manually but you need to like toggle a switch for it exactly this kind of tinkering is why I'm so excited about the pi Pico and I want to see more interactive keyboard software that via or vial currently cannot offer support for like application specific hotkeys or a gaming layer that changes the mapping depending on what game is currently launched just as examples I already did a video about using qmk on a macro PAD as a notification LED that let the twitch chat trigger lighting effects or stuff like this and I would love to see more of these in a more sophisticated software with hopefully an open API all the things for this video are of course found on my GitHub repository where you can download the 3D files for the macro pad that supports the pi Pico as well as how I did the wiring for it if you're interested in these kinds of videos and my tinkering projects feel free to subscribe every like is appreciated and see you in the next build
Info
Channel: Jan Lunge
Views: 24,214
Rating: undefined out of 5
Keywords: pi pico, mechanical keyboard, rp2040
Id: Q97bFwjQ_vQ
Channel Id: undefined
Length: 7min 40sec (460 seconds)
Published: Wed Dec 14 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.