Bluetooth Raspberry Pi Pico W Robot Controlled via PlayStation 4 Controller
it seems like Brian Starkey is busy with their robot. Using one of his best RP2040 based boards, the Pimoroni Inventor 2040 W, to build his Bluetooth controlled robot using a PlayStation 4 controller.Best of all, they shared the code Allow anyone to build their own robot.
@Raspberry_Pi #PicoW Bluetooth + PS4 Controller + @pimoroni Inventor 2040 W + @CannonFodder Chassis == Fun 😊 code: https://t.co/lXXGcRhl7g pic.twitter.com/2nT1Z9DNRLMay 16, 2023
Starkey’s hardware of choice was Pimoroni’s Inventor 2040 W board, which was reviewed at release. The robot chassis is his Tiny4WD from Coretec Robotics (aka). Brian Courteil / Canon Fodder) boasts a transparent neon yellow acrylic frame.
Our focus was on the software side of the project. Since the Raspberry Pi Pico W (which the Inventor 2040 W is based on) Bluetooth is still only available in C, Starkey says he uses C to code his robot projects and finds useful information Packed he provided a Github repository. How to download UF2 file, build and flash to his Inventor 2040 W. To simplify the connection process for Sony PlayStation 4 controllers, Starkey provides hardcoded MAC address values. /src/bt_hid.c, lines 59 to 66. Replace the corresponding line with your MAC address, flash the code to Inventor 2040 W, set the controller to pairing mode and you are good to go. Starkey said, “It’s a pretty crude project to boot his Sony DualShock 4 (PS4) controller on a Pico-W.” But in our eyes, if it works, it works.
Bluetooth support was added by SDK 1.5.0, which provides a Bluetooth API via BTstack. It offers Bluetooth LE, Bluetooth Classic, subband coding, and Bluetooth network encapsulation protocols. Bluetooth support is currently limited to both C and C++. MicroPython Bluetooth Support is currently being worked on, but there is no official release date yet.
All code and instructions can be found here: Starkey’s picow_ds4 Github repository. To use it, you need to install the C SDK toolchain. We now offer a one-click installer for Windows.