Wiimote
Wiimote Bluetooth Connection Library for Arduino core for ESP32
Install / Use
/learn @takeru/WiimoteREADME
Wiimote Bluetooth Connection Library for Arduino core for ESP32
This library provides C++ for connecting to and receiving data from Wiimotes and Wii Balance Boards. Controllers can be paired by passing through a manually triggered scan(), pressing the pair button on the device to generate a WIIMOTE_EVENT_NEW event, and finally initiate_auth() to save. After controllers are paired, they can be reconnected with only the A button or 1+2 buttons without the need for pairing. The example code demonstrates the flow shown below using a momentary button on GPIO pin 21.
Connection Flow
graph TD
I[🛜 Init] --> P1[🔴 GPIO 21 Pair Button] --> S[🫱 Scan] --> P2[🔴 Wiimote Pair Button] --> N[❇️ New Connection] --> A[🤝 Auth] --> L[📝 Add To Whitelist]
I --> B[🔘A Button] --> T[❇️ Temp Connection] --> Q{📋 Check Whitelist} --pass--> C
Q --fail--> D[❌ Disconnect]
A --> C[✅ Connected]
S --timeout--> O[✋ Stop Scan]
C-->O
C--power off-->D
P1--disconnect all-->D
Notes
- Pairing is only stored on the wiimote when using the red-sync button, pairing by pressing 1 & 2 is not saved.
- Reconnecting a paired device is easier when scanning is off.
- Scanning for new devices is harder when other devices are still connected, hence the need to disconnect all devices before starting.
- The maximum number of remotes that can be connected is 4 after they have been paired.
Interpreting Data
This library does not do all of the work of interpreting the data that streams from the wiimotes & balance boards, but the example does show how to get started with some common uses. More information is found at the references below.
References
- https://wiibrew.org/wiki/Wiimote
- https://wiibrew.org/wiki/Wiimote/Extension_Controllers
- https://wiibrew.org/wiki/Wii_Balance_Board
- http://www.yts.rdy.jp/pic/GB002/GB002.html
- http://www.yts.rdy.jp/pic/GB002/hcip.html
- http://www.yts.rdy.jp/pic/GB002/hcic.html
- http://www.yts.rdy.jp/pic/GB002/l2cap.html
- https://qiita.com/jp-96/items/ff3822ab81f7696172c0
- https://www.wdic.org/w/WDIC/Bluetooth
- https://www.wdic.org/w/WDIC/HCI%20%28Bluetooth%29
- https://www.wdic.org/w/WDIC/L2CAP
Related Skills
node-connect
335.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
335.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.7kCommit, push, and open a PR
