The Bluepad32 library makes it possible to steer your ESP32-enabled BreadboardBot with pretty much any Bluetooth gamepad.
The two microcontrollers this example has been tested with so far are the M5Stack Atom Lite and the Xiao ESP32S3.
Wiring
If you have the Xiao ESP32S3, use the base assembly wiring. If you have the M5Stack Atom, use the M5Stack Atom line follower wiring, except you do not need the line sensors (as well as any accompanying wiring on the right side of the breadboard).
Programming
The code for this example is given in code/arduino/Bluepad. You can either use the Arduino IDE or the Arduino CLI to compile and upload it to your microcontroller.
config.h
and uncomment the line #define BOARD_M5ATOM
.config.h
and uncomment the line #define MOTORS_GEEKSERVO
.ESP32
and Bluepad32 + ESP32
board packages as described here.ESP32Servo
and Adafruit NeoPixel
libraries.Bluepad.ino
in the Arduino IDE.esp32_bluepad32 -> XIAO_ESP32S3
or esp32_bluepad32 -> ESP32 PICO-D4
for M5Atom).arduino-cli compile -m <platform>
to compile the code where <platform>
is esp32s3
or m5atom
.arduino-cli upload -m <platform> -p <port>
where <port>
is the correct port (you can often find it by looking at the output of arduino-cli board list
)Result
Turn on the robot, then turn on your gamepad and set it into pairing mode. It should auto-pair with the robot (the LED will switch off (ESP32S3) or change color (M5Atom)). You can use the left & right sticks to drive the robot around.