0

I'm trying to build a robot using a Raspberry Pi 3, and I would like to control it using a Bluetooth Xbox One controller.

I am able to get the controller connected to my pi. I've verified this by running sudo jstest /dev/input/js0 . I see numeric values from the various buttons, axes, etc.

I would like to write a python program to control a robot based on this input. Is there a way to incorporate this data into a program?

Thank you

  • I know you want to write it using python, but can you understand c language? because a good start would be to check out the source code to jstest ... or maybe stackoverflow.com/questions/18300835/… – Jaromanda X Dec 10 '18 at 4:04
  • Hey thanks for the info! I tried looking into evdev, but that wasn't working well for me. My pi kept saying it was installed, and yet I couldn't point it towards any header files, or do anything else with it. I've tried doing the same project with a PS4 Dualshock controller, and it works much better. The Bluetooth connection was flawless, and I was able to read joystick and button input in Python by using the pygame joystick class. This might not be the best way to control a robot, but at least I'm able to get data from the controller. I might look into ds4drv soon... Thanks for the help!! – S. Olson Dec 17 '18 at 4:18

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.