This repository uses the original bluepad32 code to capture ps4 events and send them on ESP-NOW. The events are encoded in CBOR serialization : Header:
- to_topic : Option => null
- from_topic : Option => FNV("ps4")
- message_type : uint8 : Publish=1 or Info=2
- message_id : Option : null Payload :
- ps4_event : uint8_t : Data = 1
- dpad : uint8_t : left button pad
- left_axis_x : int16 : joystick left x axis
- .....
At regular intervals it also send via esp now the description of the topic and properties Header :
- message_type : Info Payload
- prop_id : Option : null for topic or otherwise index of property
- name : str : name of property or topic
- desc : str : 1 line description
- value_type : int,uint,str,bytes,float,...
- value_mode : read , write ,... Other features :
- It also slows down the nbr of events per sec to an interval of 100msec, if there is no change.
- it blinks the on-board esp32 led to indicate ransmission and alive
- It shpuld also support to send ESP-NOW messages to the controller for rumble and led-control in a similar format as above, to_topic = FNV("ps4")
A Bluetooth controller "host" for the ESP32, ESP32-S3, ESP32-C3, Raspberry Pi Pico W and Posix (Linux, macOS).
Add Bluetooth gamepad, mouse and keyboard support to your projects easily.
In other words, it allows you to control a robot using a DualSense controller.
Choose your target platform:
Platform | Start here | Further info | Community projects |
---|---|---|---|
Arduino IDE | Doc | Controller for Tello drone | |
Arduino using ESP-IDF toolchain | Template project | Doc | Lego Robot (video), gbaHD Shield (a GameBoy consolizer) |
Arduino + NINA coprocessor | Arduino Library | Doc | Philips CD-i meets Bluetooth |
CircuitPython + AirLift coprocessor | CircuitPython Library | Doc | Quico console, Controlling 4 servos (video) |
Pico W | Pico W example | Doc | Pico Switch, PicoNtrol |
ESP-IDF | ESP32 example | Doc | OGX-Wireless-Lite |
Posix (Linux, macOS) | Posix example | Doc | |
Unijoysticle | Unijoysticle2 | Doc | |
MightyMiggy | Unijoysticle for Amiga | Doc |
- Supports most, if not all, modern Bluetooth gamepads, mice and keyboards (see below)
- Supports ESP32 and Pico W
- Supported APIs: ESP-IDF, Pico-SDK, Arduino and CircuitPython
- Fast (very low latency)
- Small footprint
- Uses only one core (CPU0). The remaining one is free to use.
- C11 based
- Open Source (see below)
- Easy to integrate into 3rd party projects
- Sony DualSense (PS5)
- Sony DualShock 4 (PS4)
- Sony DualShock 3 (PS3)
- Nintendo Switch Pro controller
- Nintendo Switch JoyCon
- Nintendo Wii U controller
- Nintendo Wii Remote + accessories
- Xbox Wireless controller (models 1708, 1914, adaptive)
- Android controllers
- Steam controller
- Stadia controller
- PC/Window controller
- 8BitDo controllers
- Atari joystick
- iCade
- Mouse
- Keyboards
- And more
NOTE: Original ESP32 and Pico W support all listed controllers. ESP32-S3 and ESP32-C3 support only a subset.
See: Supported gamepads, supported mice and supported keyboards
Download pre-compiled binaries for Unijoysticle, Nina, AirLift, MightyMiggy:
See the examples folder which includes examples for:
- Bluepad32 for ESP32 (ESP32, ESP32-S3, ESP32-C3)
- Bluepad32 for Pico W
- Bluepad32 for Posix (Linux, macOS)
Arduino examples are in:
Bluepad32 is open source, licensed under Apache 2.
However, Bluepad32 depends on the great BTstack library. Which is free to use for open source projects. But commercial for closed-source projects.
If you are developing a commercial product for:
Notice: I’m not affiliated with BTstack people. They are super friendly and willing to help.