This project is a lightweight, browser-based tool designed to visualize the input state of the 8BitDo Ultimate 2C Wireless Controller.
It was developed primarily to reverse-engineer and document the specific control mappings (buttons and axes) of this controller for use in an embedded robotics project. By visually confirming which physical inputs correspond to which logical Gamepad API indices, we established a reliable mapping table for the hardware.
The application uses standard web technologies and requires no external libraries or frameworks:
- HTML5 & SVG: The controller is drawn programmatically using Scalable Vector Graphics (SVG). This allows for easy manipulation of individual parts (changing colors, moving joysticks) without needing external image assets.
- CSS3: Handles the visual styling and "neon glow" effects when buttons are active.
- JavaScript (Gamepad API): The core logic uses the browser's native
navigator.getGamepads()API. It polls the controller state 60 times per second (viarequestAnimationFrame) and updates the SVG elements to reflect the current state.
- Clone this repository.
- Open
index.htmlin a modern web browser (Chrome, Edge, or Firefox). - Connect your 8BitDo Ultimate 2C controller via USB or Bluetooth.
- Press any button to activate the visualizer.
- Toggle the "Show Debug Info" checkbox at the top to see raw axis values and button indices.
The following mapping was determined experimentally on a Linux system. Note that mappings can sometimes vary slightly between operating systems (Windows vs. Linux/Android).
| Physical Control | Gamepad API Index | Notes |
|---|---|---|
| A | Button 0 | |
| B | Button 1 | |
| X | Button 3 | Note the gap (Button 2 is L4) |
| Y | Button 4 | |
| L1 (Left Bumper) | Button 6 | |
| R1 (Right Bumper) | Button 7 | |
| L2 (Left Trigger) | Button 8 | Digital click at bottom of press |
| R2 (Right Trigger) | Button 9 | Digital click at bottom of press |
| L4 (Extra Left) | Button 2 | Located next to L1/L2 |
| R4 (Extra Right) | Button 5 | Located next to R1/R2 |
| View (Back/-) | Button 10 | Left of center cluster |
| Menu (Start/+) | Button 11 | Right of center cluster |
| Home (Logo) | Button 12 | Center of controller |
| L3 (Left Stick Click) | Button 13 | Press down on left stick |
| R3 (Right Stick Click) | Button 14 | Press down on right stick |
| Physical Control | Gamepad API Axis | Range / Values |
|---|---|---|
| Left Stick X | Axis 0 | -1.0 (Left) to 1.0 (Right) |
| Left Stick Y | Axis 1 | -1.0 (Up) to 1.0 (Down) |
| Right Stick X | Axis 2 | -1.0 (Left) to 1.0 (Right) |
| Right Stick Y | Axis 5 | -1.0 (Up) to 1.0 (Down) |
| L2 Trigger | Axis 3 | -1.0 (Released) to 1.0 (Pressed) |
| R2 Trigger | Axis 4 | -1.0 (Released) to 1.0 (Pressed) |
| D-Pad | Axis 9 | Hat Switch (Discrete Values) Up: ~ -1.00 Right: ~ -0.43 Down: ~ 0.14 Left: ~ 0.71 |
Note: The Star and Profile buttons are handled internally by the controller firmware (for Turbo/Macros) and typically do not send events to the host device.
