https://github.com/natk64/esp32-gamepads
Retro Gamepads for ESP32
https://github.com/natk64/esp32-gamepads
esp32 gamepad retrogaming
Last synced: 2 months ago
JSON representation
Retro Gamepads for ESP32
- Host: GitHub
- URL: https://github.com/natk64/esp32-gamepads
- Owner: natk64
- License: gpl-3.0
- Created: 2023-02-24T13:32:54.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-01-01T18:49:58.000Z (6 months ago)
- Last Synced: 2026-01-07T02:31:42.281Z (6 months ago)
- Topics: esp32, gamepad, retrogaming
- Language: C++
- Homepage:
- Size: 25.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ESP32-Gamepads
This library allows the ESP32 to interface with many retro gamepads
## Supported Gamepads
- NES
- SNES
- N64
- Gamecube
- Genesis/Mega drive
## Installation
Clone [ESP32-N64-RMT](https://github.com/NicoKleinschmidt/ESP32-N64-RMT) and this Repo into the components directory of your ESP-IDF project
## Basic Usage
```cpp
// Create a new Gamepad.
// Set the pin numbers the gamepad is connected to.
GamepadNES gamepad(17, 19, 21);
// Initialize the Gamepad.
gamepad.initialize();
for(;;)
{
// Call update to get current values.
gamepad.update();
// Print button states.
ESP_LOGI("NES",
"A: %d B: %d, SELECT: %d, START: %d, UP: %d, DOWN: %d, LEFT: %d, RIGHT: %d",
gamepad.a(),
gamepad.b(),
gamepad.select(),
gamepad.start(),
gamepad.up(),
gamepad.down(),
gamepad.left(),
gamepad.right());
// Wait 20ms before next update.
vTaskDelay(20 / portTICK_PERIOD_MS);;
}
```