Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zkxs/footswitch

Arduino-based switch-to-keyboard bridge
https://github.com/zkxs/footswitch

Last synced: about 2 months ago
JSON representation

Arduino-based switch-to-keyboard bridge

Awesome Lists containing this project

README

        

# Footswitch

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.

## Building the Device

First, acquire the necessary components and tools:

| Quantity | Item |
| -------- | ---- |
| 1 | [Arduino ProMicro ATmega32U4](https://www.amazon.com/gp/product/B012FOV17O) (comes with the 12 pin connectors for a breadboard). You could also use a different board, so long as it supports the [keyboard](https://www.arduino.cc/reference/en/language/functions/usb/keyboard/) library. |
| 1 | USB Mini Male to USB A Male cable |
| 1 | Breadboard or protoboard |
| *n* | [Digital foot pedals](https://www.amazon.com/gp/product/B00005ML71) |
| *n* | [1/4" headphone jacks](https://www.digikey.com/en/products/detail/amphenol-sine-systems-corp/ACJS-MV-3/7105425)
| *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**

## Compiling & Uploading with Arduino CLI

Install [Arduino CLI](https://github.com/arduino/arduino-cli)

One-time setup:

```shell
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:

```shell
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
```

## Compiling and Uploading with Visual Studio Code's Arduino Extension

1. Install the [Arduino Extension](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.vscode-arduino)
2. Use the board manager to install `arduino:avr` board support
3. Use the library manager to install `Keyboard` library
4. Somehow run the equivalent of `arduino-cli update; arduino-cli upgrade` to unfuck the default installation
5. Select the correct serial port for upload.
6. Run the `Arduino CLI: Upload` command