Search code examples
python-2.7xbox-one

Read Xbox One Controller Inputs with Python


I am trying to find a way to read Xbox One controller inputs with python on a Raspberry pi. I have found a library for an Xbox 360 controller, but this doesn't seem to recognize the Xbox One controller. I am able to connect the controller to my computer. I would use a 360 controller but I need to be wireless. I am using the standard Xbox One controller that comes with the Xbox.


Solution

  • A wireless xbox 360 controller can be used with a receiver (buy it online) and installing xboxdrv with:

    sudo apt-get install xboxdrv
    

    This repository can then be used to get input https://github.com/FRC4564/Xbox Their docs explain using it.

    For using an xbox one controller with python you can use the library evdev to the input values. Here is a guide which shows every usage case:

    https://diyprojects.io/python-library-evdev-raspberry-pi-use-gamepad-diy-projects-servomotor-games/#.Xa8ZR-gzaUl