Communication and Control system for HADB BattleDroids.
Check out the Sequence Syntax Guide to learn how to create timed droid performances.
The firmware is located in firmware/BattleDroid/. It is designed for ESP32 boards and uses ESP-NOW for peer-to-peer communication.
| Component | Channel / Function | Command Identifier | ESP32 GPIO Pin | Details |
|---|---|---|---|---|
| Servo | Head Turn | headturn |
GPIO 13 | 500µs – 2500µs pulse range |
| Servo | Head Tilt | headtilt |
GPIO 14 | 500µs – 2500µs pulse range |
| Servo | Torso Turn | torsoturn |
GPIO 12 | 500µs – 2500µs pulse range |
| OLED Display | I2C SDA / SCL | - | GPIO 4 / GPIO 5 | SSD1306 128x64 |
| SD Card | SPI (CS, SCK, MISO, MOSI) | - | 22, 18, 19, 23 | SPI SD module |
| Audio DAC | I2S (BCLK, LRC, DOUT) | - | 26, 25, 27 | Makerfabs I2S Audio |
This project is compiled and uploaded using arduino-cli or the Arduino IDE.
Important
Critical Board Package & Hardware Constraints:
- ESP32 Core Version
3.3.7Required: Core version3.3.8contains a regression in standard SPI mapping that breaks SD card operations. You must use version3.3.7. - PSRAM Enabled: On ESP32-WROVER boards (like the Makerfabs ESP32), PSRAM must be explicitly enabled during compile. If omitted, the internal cache conflicts with the SPI/SD lines, resulting in an
SD FAILon boot.
To ensure compilation consistency, install and lock the core package version to 3.3.7 via arduino-cli:
# Downgrade/install core 3.3.7
arduino-cli core install esp32:esp32@3.3.7Required Libraries: Ensure the following libraries are installed in your sketchbook directory:
Adafruit GFX LibraryAdafruit BusIOAdafruit SSD1306ESP32-audioI2S-masterESP32ServoFastLED
Compile the BattleDroid sketch using the fully-configured WROVER FQBN:
arduino-cli compile --fqbn esp32:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app firmware/BattleDroidUpload the compiled binary to the designated COM port using the same FQBN:
arduino-cli upload -p <PORT> --fqbn esp32:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app firmware/BattleDroid(For example, replacing <PORT> with COM14 or COM17 depending on the active USB-to-UART bridge).