Open-source, low-cost BLE adaptive switch interfaces for iPadOS/iOS Switch Control and Android Switch Access.
View the Project on GitHub mrhunsaker/Assistive_Switch_Interfaces
ESP32-S3 SuperMini · BLE HID Keyboard · 3-Switch Directional Controller
A stripped-down variant of the BLE Adaptive Switch Node scaffold. This build has no touch sensors and no proximity sensor — only 3 mechanical switches mounted on top of an enclosure (left / middle / right), each sending a unique HID keystroke: LEFT_ARROW, ENTER, and RIGHT_ARROW.
📄 Source:
BLE_3_SWITCH_INTERFACE/in the repository
| Position | GPIO | pinMode | HID Key | LED Color |
|---|---|---|---|---|
| Left (lowest GPIO) | 4 | INPUT_PULLUP |
LEFT_ARROW (0x50) |
Blue |
| Middle | 5 | INPUT_PULLUP |
ENTER (0x28) |
Green |
| Right (highest GPIO) | 6 | INPUT_PULLUP |
RIGHT_ARROW (0x4F) |
Red |
The lowest-numbered GPIO is the physically left switch and sends LEFT_ARROW; the middle GPIO is the physically middle switch and sends ENTER; the highest-numbered GPIO is the physically right switch and sends RIGHT_ARROW.
GPIO 4, 5, 6 were chosen because they’re free general-purpose pins on the ESP32-S3 SuperMini, well clear of GPIO 0 (BOOT), GPIO 3 (JTAG strapping — avoided per the parent project’s policy even though it isn’t adjacent here), GPIO 19/20 (USB D-/D+), GPIO 45/46 (strapping), and GPIO 48 (NeoPixel). If your enclosure wiring makes a different trio of pins more convenient, you can freely renumber SWITCH_PINS[] in the .ino — just keep the array in ascending GPIO order so index 0/1/2 stay left/middle/right.
Each switch connects between a GPIO pin and GND. INPUT_PULLUP is used internally, so no external resistor is needed — a simple normally-open momentary switch is all that’s required, identical to the mechanical-switch wiring in the parent scaffold.
DebouncedBtn struct instance (its own stable, last, and t fields) stored in its own array slot.handleSwitch(id) only ever reads/writes the array element for that one id. Nothing in the send path is shared across switches except the BLE input characteristic itself (a physical necessity — all keys share one BLE HID connection), which does not carry any state between calls.In short: three independent debounce timers, three independent edge-trigger checks, three independent sendKey() calls. One switch being pressed, held, or bouncing can never suppress, delay, or spuriously trigger another switch’s keystroke.
Identical to the parent scaffold:
BT Switch 3 until a host connects.0x180F, pinned at 100%), which was required for reliable pairing on the Android device (Nokia G100 / Android 12) the parent project was verified against.| Platform | Status |
|---|---|
| iPadOS / iOS Switch Control | Expected (same HID report map as verified parent project) |
| Android Switch Access | Expected (same HID report map + Battery Service as verified parent project) |
| Windows / macOS / Linux | Expected (standard BLE keyboard profile) |
Since this build reuses the exact same report map, Battery Service, and reconnect logic that were already verified in the parent project, it should behave identically on all the same platforms — but re-verify on your specific target devices before deployment, since the input mapping (3 switches → arrows/Enter instead of 11 inputs → function keys) is new.
Same fade engine as the parent project: a color snaps to a target on activation and fades back to off if there’s no activity for 250 ms.
| LED Color | Meaning |
|---|---|
| Blue | Left switch pressed → LEFT_ARROW |
| Green | Middle switch pressed → ENTER |
| Red | Right switch pressed → RIGHT_ARROW |
| Off | Idle |
NimBLE-ArduinoAdafruit NeoPixelNo touch-sensor or proximity-sensor libraries are required for this build — they’ve been removed entirely, along with the #define USE_... sensor-selection block and the <HIDKeyboardTypes.h> include (unused in either project, since all keycodes are sent as raw hex values).
See the repository-wide pinned library versions for the exact versions this project has been verified against.
Tools → Board → Boards Manager, search “esp32”, install ESP32 by Espressif Systems, version 2.0.17 — see the board package note).Tools → Board → ESP32 Arduino → ESP32S3 Dev Module.BLE_3_SWITCH_INTERFACE.ino.types_3switch.h is present in the same folder.NimBLE-Arduino and Adafruit NeoPixel via Sketch → Include Library → Manage Libraries.Tools → Port.=== SETUP COMPLETE === prints.BT Switch 3 from your host device’s Bluetooth settings.