Way to map GPIO buttons (RaspberryPi) to gamepad (Gamepad API)

163 views Asked by At

I have RaspberryPi 4 with few buttons connected to GPIO pins. I want to map those buttons to act like gamepad to be accessable trough browser's Gamepad API.

Is there any way on backend (NodeJS, Python) to map those raw inputs into actual gamepad inputs (best would be from scratch, not with some library) my Gamepad API will recognize it as proper controller?

I found few libraries and examples, but I want to really understand how to do it from scratch and without libraries.

1

There are 1 answers

0
DenverCoder9 On

I guess your best bet is to look how ViGEmBus approaches this. They emulate gamepads on Windows, but the overall approach might probably help you adapt this for your environment.