# PiCar-X with bluetooth game controller?

**URL:** <https://forum.sunfounder.com/t/picar-x-with-bluetooth-game-controller/4088>\
**Category:** Robotic kit for Raspberry Pi\
**Created:** [December 10, 2025, 6:03pm UTC](https://forum.sunfounder.com/t/picar-x-with-bluetooth-game-controller/4088 "2025-12-10T18:03:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![FransK](https://avatars.discourse-cdn.com/v4/letter/f/ecae2f/32.png) [@FransK](https://forum.sunfounder.com/u/FransK)\
**Post date:** [December 10, 2025, 6:03pm UTC](https://forum.sunfounder.com/t/picar-x-with-bluetooth-game-controller/4088/1 "2025-12-10T18:03:37Z")

</div>

Hi, I have assembled my new Picar-X and am waiting for a new Raspberry Pi 5 to arrive.  
Is there some description or (python) example how to use a XBox (compatible) bluetooth game controller to control the PiCar functions?

---

<div class="post-metadata">

**Author:** ![Spf650](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Spf650](https://forum.sunfounder.com/u/Spf650)\
**Post date:** [December 10, 2025, 7:13pm UTC](https://forum.sunfounder.com/t/picar-x-with-bluetooth-game-controller/4088/2 "2025-12-10T19:13:25Z")

</div>

I wrote one for a ps4 controller and pidog a couple of years ago. I don’t remember if I shared it on this forum or not. I’m sure lots of people have probably done this as it’s an oft made request, and they may be able to share.

If not, when I get time, I’ll try to see if I still have a copy around anywhere, but I am prone to reusing my old sd cards and wiping any old code on them!

The basic development flow was…

Pair controller with rpi BT.

Press all the controller buttons and capture the BT responses in a file

Then write some python to send these same commands to a modified version of Sunfounders control software.

---

<div class="post-metadata">

**Author:** ![Spf650](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Spf650](https://forum.sunfounder.com/u/Spf650)\
**Post date:** [December 10, 2025, 7:38pm UTC](https://forum.sunfounder.com/t/picar-x-with-bluetooth-game-controller/4088/3 "2025-12-10T19:38:36Z")

</div>

Memory coming back. I wrote this as a pair of coupled ROS nodes as part of a bigger ros project, so unnecessarily complex for a simple controller. I don’t think I ever did a standalone version.

---

<div class="post-metadata">

**Author:** ![FransK](https://avatars.discourse-cdn.com/v4/letter/f/ecae2f/32.png) [@FransK](https://forum.sunfounder.com/u/FransK)\
**Post date:** [December 11, 2025, 6:02am UTC](https://forum.sunfounder.com/t/picar-x-with-bluetooth-game-controller/4088/4 "2025-12-11T06:02:15Z")

</div>

Thanks, actually I am looking for a python example of the first part “pair and communicate with a BT/BLE joystick controller in python” to get a fast start for the second part.  
I used to be a software developer for some time, retired now, but have no experience with bluetooth/ble programming.

Interesting: ROS sending a barking piDog to the backyard gate when someone enters 😀. Have followed an online ROS course (DelftX university in the Netherlands) a few years ago, but never got to use it. Though 2 cooperating lego cars might be a good idea, a loader and a dump truck and an AI camera.

---

<div class="post-metadata">

**Author:** ![Spf650](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Spf650](https://forum.sunfounder.com/u/Spf650)\
**Post date:** [December 11, 2025, 7:27am UTC](https://forum.sunfounder.com/t/picar-x-with-bluetooth-game-controller/4088/5 "2025-12-11T07:27:57Z")

</div>

I started from here ..

> **[Connecting PS4 controller to Raspberry Pi via Bluetooth](https://salamwaddah.com/blog/connecting-ps4-controller-to-raspberry-pi-via-bluetooth)**
>
> {"type":"doc","content":\[{"type":"paragraph","attrs":{"textAlign":"start"},"content":\[{"type":"text","text":"You're probably here because you tried to...

and here

> **[GitHub - ArturSpirin/pyPS4Controller: Light module (less than 30KB) without any...](https://github.com/ArturSpirin/pyPS4Controller)**
>
> Light module (less than 30KB) without any dependencies designed to provide hooks for PS4 Controller events

---

<div class="post-metadata">

**Author:** ![Spf650](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Spf650](https://forum.sunfounder.com/u/Spf650)\
**Post date:** [December 11, 2025, 7:36am UTC](https://forum.sunfounder.com/t/picar-x-with-bluetooth-game-controller/4088/6 "2025-12-11T07:36:02Z")

</div>

Here’s a link to some other work and my scripts that I wrote to help another query to install and run ROS2 onto rpi platform

> [@ROS2 Builds for the PiDog/PiCar](https://forum.sunfounder.com/t/ros2-builds-for-the-pidog-picar/3613):
>
> I’ve seen a couple of posts about ROS2 Builds for the PiCar-X and Pi-Dog, thought it might be a good idea to group them here so we can share experiences. I’ve been trying: [danhermes/Nevil-picar-v2](https://github.com/danhermes/Nevil-picar-v2/tree/main) Build but got stuck at 3. Install ROS2 on Raspberry Pi (ARM64), there is no start.py. But i’m a noob at Python and github. So what other ROS2 installs have people done and what success did you have with the onboard sensors. Have you extended to have other sensors.

I used ROS2 to create a suitable environment in which to automate pidog via orbslam3. I’ve posted the final scripts and operating videos etc on this forum somewhere! But it was some time ago and they may have expired by now, not sure, not really developing stuff any more

---

<div class="post-metadata">

**Author:** ![FransK](https://avatars.discourse-cdn.com/v4/letter/f/ecae2f/32.png) [@FransK](https://forum.sunfounder.com/u/FransK)\
**Post date:** [December 12, 2025, 2:36pm UTC](https://forum.sunfounder.com/t/picar-x-with-bluetooth-game-controller/4088/7 "2025-12-12T14:36:25Z")

</div>

> [@Spf650](#):
>
> I used ROS2 to create a suitable environment in which to automate pidog via orbslam3

Thanks, orbslam3 + ROS is very interesting, I will try it when my piCar and Lego cars can be controlled from my pc.  
My rPi 5 has arrived, is blazingly fast with a NVMe base mounted SSD as drive (I hope the battery will not be drained too fast), yet to install the robotHat software.

For access to the game controller, I will try [hid\_gamepad](https://github.com/ppieczywek/hid_gamepad) or pyglet [https://pyglet.org/](https://pyglet.org/) , [https://github.com/pyglet/pyglet](https://github.com/pyglet/pyglet) (pure python, using system openGL library)

---

<div class="post-metadata">

**Author:** ![Spf650](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Spf650](https://forum.sunfounder.com/u/Spf650)\
**Post date:** [December 12, 2025, 2:49pm UTC](https://forum.sunfounder.com/t/picar-x-with-bluetooth-game-controller/4088/8 "2025-12-12T14:49:41Z")

</div>

Welcome to the retired engineers club 😉
