No description
Find a file
Kumi 87a8eb98e3
feat: add Arduino sketch for ESP32 BLE footswitch
Introduced an Arduino sketch utilizing the BleKeyboard library, enabling keypress transmission from an ESP32 via BLE upon footswitch activation. Configured GPIO 25 for connection and assumed a normally open footswitch design. This setup facilitates toggling microphone status using a predefined key in KDE Plasma, enhancing user control. The inclusion of README.md provides setup context and operational guidance.
2024-10-22 15:22:28 +02:00
footswitch.ino feat: add Arduino sketch for ESP32 BLE footswitch 2024-10-22 15:22:28 +02:00
README.md feat: add Arduino sketch for ESP32 BLE footswitch 2024-10-22 15:22:28 +02:00

ESP32 BLE Footswitch

This is a really simple Arduino IDE sketch that uses the BleKeyboard library to send a keypress from an ESP32 to your PC via Bluetooth Low Energy when a footswitch is activated.

The footswitch is connected to ground and GPIO 25 on the ESP32, because that was the most convenient option for me, using a D1 Mini from AZ-Delivery and 5mm 2-pin screw terminals.

I used a generic footswitch that I had lying around, those are available at your favorite electronics store or online for a few euros. The sketch assumes that the footswitch is normally open and closes the circuit when pressed. If you have a normally closed footswitch, you can just update the sketch accordingly.

The sketch sends the "Bookmarks" media key both when it is pressed and when it is released. I chose that key because it was unused on my system and others (like F18) didn't seem to work for some reason. I then added a shortcut in KDE Plasma to trigger the action I wanted when that keypress is received, which was to toggle the microphone on and off. This way, I can have my microphone muted by default and only enable it temporarily while I'm speaking.