Arduino program allowing digital or analog switches to control keyboard buttons. For example, you could use a piano sustain pedal to control a Shift key.
I personally use this for push-to-talk keys, as moving them off my keyboard/mouse and onto foot pedals is great for situations where your hands are both fully occupied.
First, acquire the necessary components and tools:
Quantity | Item |
---|---|
1 | Arduino ProMicro ATmega32U4 (comes with the 12 pin connectors for a breadboard). You could also use a different board, so long as it supports the keyboard library. |
1 | USB Mini Male to USB A Male cable |
1 | Breadboard or protoboard |
n | Digital foot pedals |
n | 1/4" headphone jacks |
n | Mystery resistors? Pullup? Pulldown? Aren't these built in to the board? TODO |
1 | Switch TODO: SWITCH SPECS |
1 | Soldering Iron |
Solder | |
1 | Wire stripper/cutter |
Some length of breadboarding wire (22awg) |
Second, put it all together as follows:
TODO: SCHEMATIC
Install Arduino CLI
One-time setup:
arduino-cli update # Fetch index of cores and libraries
arduino-cli core install arduino:avr # Install necessary core for Arduino ProMicro ATmega32U4
arduino-cli lib install Keyboard # Install keyboard library
Compile & upload:
arduino-cli upgrade # Upgrade cores and libraries
arduino-cli board list # get the com port of your board from this
arduino-cli compile --fqbn arduino:avr:micro --port COM3 --upload
- Install the Arduino Extension
- Use the board manager to install
arduino:avr
board support - Use the library manager to install
Keyboard
library - Somehow run the equivalent of
arduino-cli update; arduino-cli upgrade
to unfuck the default installation - Select the correct serial port for upload.
- Run the
Arduino CLI: Upload
command