Overview
The Raspberry Pi Pico W, while not having native Bluetooth hardware, opens the door to BLE functionality when paired with additional hardware like an nRF52 module or if using the RP2040 chip on a custom board that includes BLE. This guide explores how to emulate swipe-like HID input using BLE for projects involving the Pico W or RP2040-based boards with BLE capability.
1. BLE on Pico W — The Reality
The Pico W itself only supports Wi-Fi out of the box. BLE is not available unless:
- You use an external BLE module (e.g., nRF52840 via UART/SPI)
- You’re using a custom RP2040 board that integrates BLE (rare but possible)
- You emulate BLE through USB HID if acting as a host to a BLE peripheral (advanced)
So, when we say “BLE with Pico,” it usually implies RP2040 + BLE module.
2. Swipe Emulation via HID (BLE or USB)
A. BLE HID (With External BLE Module)
- You can use libraries like Adafruit TinyUSB, NimBLE, or CircuitPython BLEIO (limited)
- Emulate a BLE Mouse by sending:
move(x, y)
for cursor shiftclick()
to simulate tap
- Combine movement + tap to mimic a swipe gesture
B. USB HID (More reliable with Pico W alone)
- Pico W can emulate a USB HID device (mouse/keyboard)
- You can plug it into a PC, Android (via OTG), or Raspberry Pi
- Use directional movement or keycodes (
KEY_UP
,KEY_DOWN
, etc.) to scroll or trigger swipe events in software
3. Platform Compatibility (BLE HID or USB HID)
Platform | BLE HID Support | USB HID Support | Notes |
---|---|---|---|
iOS | ❌ Limited | ❌ Requires MFi | BLE HID rarely accepted |
Android | ✅ Good | ✅ OTG support | Ideal for both modes |
Windows | ✅ Excellent | ✅ Excellent | Works out of the box |
macOS | ✅ Excellent | ✅ Excellent | Supports HID well |
4. Recommended Setup for Pico Swipe Projects
A. USB HID Mode (Recommended for Simplicity)
- Use
TinyUSB
stack for HID mouse - Use buttons or sensors to trigger movement
- Implement smooth
move()
loops and optional click
for (int i = 0; i < 5; i++) {
tud_mouse_move(0, 10);
delay(20);
}
// Optional tap
tud_mouse_click(true);
delay(100);
tud_mouse_click(false);
B. BLE HID Mode (Advanced)
- Requires custom firmware or external BLE stack
- Use UART/SPI to talk to nRF module
- Libraries: NimBLE-Arduino, CircuitPython BLEIO (unstable)
5. Limitations & Warnings
- BLE on Pico W isn’t native: always requires extra hardware
- BLE latency can cause jittery movement
- iOS has strict limitations for HID input from unknown BLE devices
- USB HID is more stable and predictable across platforms
Conclusion
While the Raspberry Pi Pico W doesn’t support BLE directly, it’s a powerful tool for HID-based input—especially through USB. If your goal is swipe emulation or remote control, USB HID offers a smoother, more predictable experience. For BLE HID, you’ll need to dive deeper into external modules and firmware handling.
If you’re building a custom HID controller or macro pad, the Pico W is excellent—with BLE, you’re entering a more advanced realm, but the flexibility is there for those ready to tinker.