NES controller to USB HID gamepad.
Reads a native NES controller via PIO-based shift register protocol and outputs as a USB HID gamepad. 60Hz polling with fractional timing correction for accurate cadence. Automatic connect/disconnect detection with 500ms debounce and stuck-button prevention.
NES Input -- PIO shift register protocol at 1MHz instruction clock. CLK (GPIO 5), LATCH (GPIO 6), DATA (GPIO 8).
USB Device Output -- USB HID gamepad with multiple emulation modes.
| Setting | Value |
|---|---|
| Routing mode | SIMPLE (1:1) |
| Player slots | 1 (fixed) |
| Polling rate | 60Hz (fractional correction for accuracy) |
| Profile system | None |
- Auto-detection -- Controller connected/disconnected detected via DATA line state.
- USB output modes -- SInput, XInput, PS3, PS4, Switch, Keyboard/Mouse. Double-click button to cycle, triple-click to reset.
- Web config -- config.joypad.ai.
| Board | Build Command |
|---|---|
| KB2040 | make nes2usb_kb2040 |
| Pico W | make nes2usb_pico_w |
make nes2usb_kb2040
make flash-nes2usb_kb2040Controller not detected:
- Check NES port wiring, especially GND and VCC.
- Verify CLK, LATCH, and DATA pin assignments match your board.
- Ensure the NES controller is fully seated in the connector.
No response from buttons:
- Confirm the adapter is powered (NeoPixel LED should be lit).
- Try a different NES controller to rule out a faulty controller.
- Check that the DATA line has continuity from the controller port to GPIO 8.
Wrong buttons or garbled input:
- Verify CLK and LATCH are not swapped.
- Check for cold solder joints on signal lines.
- Use config.joypad.ai input monitor to view raw input state.
USB not recognized by host:
- Double-click the board button to cycle USB output mode.
- Triple-click to reset to SInput (default HID mode).
- Try a different USB cable or port.