How cxrphly/line-bot works
LineBot is an ESP32 line-following robot with PID-based autonomous driving, Bluetooth manual control, OLED menus and calibration/configuration. The user connects a gamepad, selects a mode or adjusts settings, and the firmware reads sensors or controller inputs to drive the motors and update the display. Calibration and PID settings persist in ESP32 preferences. The README also documents 3D-printable and laser-cut chassis designs. The main sketch was not sampled, so its setup/loop wiring is not shown; runtime links below follow only the sampled calls and documented capabilities.
Main entry points: gamepad.cpp Gamepad handling · LineFollower.cpp Line-follow control · motors.cpp Motor control · oled_ui.cpp OLED menus
Components 14
Control and display
- Gamepad handling
gamepad.cpp - OLED menus
oled_ui.cpp - Pin and runtime config
config.h
Line following
- Line-follow control
LineFollower.cpp - QTR sensor array
- Sensor calibration
LineFollower.cpp - ESP32 preferences
Robot hardware
- Motor control
motors.cpp - TB6612 motor driver
- OLED display
Chassis designs
- 3D models and parts
design/3d - Laser-cut chassis
design/laser-cut
Other components
- Robot operator
- Bluetooth gamepad
Connections 16
- Robot operator → Bluetooth gamepad: presses controls
- Bluetooth gamepad → Gamepad handling: sends inputs
- Gamepad handling → OLED menus: updates menus
- OLED menus → OLED display: draws screens
- Gamepad handling → Motor control: manual drive
- Gamepad handling → Line-follow control: starts calibration
- Line-follow control → QTR sensor array: reads sensors
- Line-follow control → Motor control: sets speeds
- Sensor calibration → QTR sensor array: calibrates
- Sensor calibration → Motor control: turns robot
- Sensor calibration → ESP32 preferences: reads/writes calibration
- Line-follow control → ESP32 preferences: reads/writes PID settings
- Gamepad handling → ESP32 preferences: saves settings
- Motor control → TB6612 motor driver: sets PWM and direction
- Robot operator → 3D models and parts: uses for fabrication
- Robot operator → Laser-cut chassis: uses for fabrication