Tilt an MPU-6050 to steer a Wi-Fi robot. A TM4C123 reads accelerometer data over I2C, maps tilt to motion commands, and an ESP32 SoftAP robot drives motors through an L298N.
- Sense — MPU-6050 Accel X/Y over I2C
- Decide — TM4C123 thresholds →
F/B/L/R/S - Bridge / Act — ESP32 SoftAP robot receives TCP commands and drives L298N
controller/main.c # TM4C123 bare-metal C (I2C + UART AT / command path)
robot/main.cpp # ESP32 SoftAP TCP motor firmware
docs/ # Architecture + wiring diagrams
| Component | Role |
|---|---|
| MPU-6050 | 6-axis IMU (tilt) |
| TM4C123 LaunchPad (EK-TM4C123GXL) | Bare-metal controller |
| ESP32 DevKit | SoftAP robot MCU |
| L298N | Dual H-bridge |
| 4WD robot chassis + DC motors | Actuation |
| Condition | Command | Motion |
|---|---|---|
| Accel X high | F |
Forward |
| Accel X low | B |
Backward |
| Accel Y high | R |
Right |
| Accel Y low | L |
Left |
| Deadband | S |
Stop |
| Signal | Pin |
|---|---|
| I2C1 SCL | PA6 |
| I2C1 SDA | PA7 (open-drain) |
| MPU address | typically 0x68 / 0x69 (AD0) |
| RGB LEDs | PF1 / PF2 / PF3 |
| GPIO | L298N |
|---|---|
| 32 | IN1 |
| 33 | IN2 |
| 25 | IN3 |
| 26 | IN4 |
Use Arduino IDE or PlatformIO with robot/main.cpp.
Build controller/main.c with Keil / CCS / your TM4C toolchain that provides TM4C123.h.
Before flashing, set SoftAP credentials in both firmwares to matching placeholders:
ConnectToWiFi("YOUR_AP_SSID","YOUR_AP_PASS");Hold the MPU board, tilt forward/back/left/right, and watch the robot mirror the motion. RGB LEDs on the LaunchPad show the active direction.
MIT

