Some keyboard definitions are designed for the RP2040. A simple example is the "onekey" keyboard. You can easily test this on a breadboard with a Raspberry Pi Pico and a simple button, so it's a great way to get started. This guide shows how to build the firmware file yourself, but if you want to take a short cut you can use the uf2 file below:
- Connect GP4 to one terminal of the button
- Connect GP5 to the diagonally opposite terminal of the button
Now, open up the terminal/command window, and change to the qmk_firmware directory.
Next, plug in you Pico while holding down the BOOT button so that the RPI-RP2 drive appears.
To build and install the firmware, issue the following command:
cd ~/qmk_firmware qmk flash -kb handwired/onekey/rp2040 -km default
This will produce a lot of output. The start and end should look something like this:
~/qmk_firmware$ qmk flash -kb handwired/onekey/rp2040 -km default Ψ Compiling keymap with gmake --jobs=1 handwired/onekey/rp2040:default:flash QMK Firmware 0.17.5 Making handwired/onekey/rp2040 with keymap default and target flash arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.2.1 20201103 (release) Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Generating: .build/obj_handwired_onekey_rp2040/src/info_config.h [OK] …[many lines skipped] Copying handwired_onekey_rp2040_default.uf2 to qmk_firmware folder [OK] Size after: text data bss dec hex filename 0 30824 0 30824 7868 handwired_onekey_rp2040_default.uf2 Flashing /media/jepler/RPI-RP2 (RPI-RP2) Wrote 61952 bytes to /media/jepler/RPI-RP2/NEW.UF2
The Raspberry Pi Pico will automatically restart with the new firmware. Your computer may notify you that a new keyboard has been connected. When you press the button, it will type the letter "a".
To change the key, you can open the file qmk_firmware/keyboards/handwired/onekey/keymaps/default/keymap.c. Just change KC_A
to any valid key. For instance, to make it a mute button, use KC_KB_MUTE
— generally, this special key will mute or unmute the computer's main sound output. QMK has a Frequently Asked Questions page about keycodes and keymaps as well as a full list of all keycodes, so head over there to learn more about the possibilities.
#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_ortho_1x1(KC_A) // Try changing KC_A to KC_KB_MUTE };
Page last edited March 08, 2024
Text editor powered by tinymce.