Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 3.37 KB

README.md

File metadata and controls

61 lines (45 loc) · 3.37 KB

RP2040-Macro-Keyboard

This is designed to type commonly used text at the press of a button. For example, if you type "thank you" 20 times a day, you could make that a button. Working in IT, I can type the same server names or IP addresses multiple times in a span of a few minutes. This allows me to type those server names at the press of one button.

Finished PCB

About the code

This project is written in Adafruit's Circuit python and relies on the adafruit_hid library. The button actions are defined in a text file called macros.txt.

RP2040 Files/Prep

  1. Install Circuit Python on your RP2040
  2. Copy lib to lib on your RP2040
  3. Download and edit macro.txt. Replace the text after the colon : with what you want each button to type. The number coresponds to the IO number on the RP2040.
   00:text
  1. Replace the contents of code.py with PoorManMacros_1.py
  2. If you want to disable the CIRCUITPY USB drive from showing up, add the following to boot.py. If you need to access the CIRCUITPY drive, slow press the reset button twice.
   import storage
   storage.disable_usb_drive()

Parts/Schematic

1x RP2040
16x 1k Resistors (noted as Z1-Z16) I used 16x 1k Ohm 0603 form factor resistors in my PCB. If you are designing your own PCB, feel free to use something else.
16x 12mmx12mm Buttons
16x Button Caps (optional)
1x PCB Bumper (optional)
Rotary Encoder for Media Control (Optional)
1x EC11 Rotary Encoder
2x 10k Ohm 0603 resistors (noted as Z17, Z18)
1x 10k Ohm through hole resistor \

Button Setup Schematic PCB

Rotary Encoder/Media Control

As a second ideration of the design, a rotary encoder was added to allow media control (pause/play, volume up/down, next/last song).

A 10k Ohm resistor is needed between GND and Pin 26 as shown below for the button to function correctly.

The setup for the buttons is similar to how the macro buttons are defined. These keys are using the Adafruit Consumer Control library. Additional functions can be defined as needed.

press1:PLAY_PAUSE
doublepress:MUTE
right1:VOLUME_INCREMENT
left1:VOLUME_DECREMENT
pressright:SCAN_NEXT_TRACK
pressleft:SCAN_PREVIOUS_TRACK

Rotary Encoder Schematic Rotary Encoder PCB