How taifur20/line_follower_v1 works
This is STM32F103 firmware for a sensor-guided line-following robot. Its main application combines line-position/PID motor control with button-operated stop and calibration modes; calibration also visualizes sensor values on an SSD1306 display. The display driver and font data are distinct internal layers, backed by STM32 HAL and CMSIS vendor code. The excerpts show motor GPIO writes and display calls, but omit much of initialization and sensor acquisition; uncertain hardware links are therefore dashed and uncited.
Main entry points: main.c Robot control · ssd1306.c Display driver · stm32f1xx_hal.c STM32 HAL · stm32f103xb.h STM32F103 registers
Components 11
Robot firmware
- Robot control
Core/Src/main.c
Display
- Display driver
Core/Src/ssd1306.c - Font data
Core/Src/fonts.c
MCU platform
- STM32 HAL
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c - I2C HAL
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c - STM32F103 registers
Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h - CMSIS core
Drivers/CMSIS/Include/core_cm3.h
Other components
- Operator
- Line sensors
- Drive motors
- SSD1306 display
Connections 10
- Operator → Robot control: operates
- Line sensors → Robot control: provides readings
- Robot control → Drive motors: sets GPIO
Core/Src/main.c - Robot control → Display driver: draws and updates
Core/Src/main.c - Display driver → SSD1306 display: updates screen
- Display driver → Font data: uses fonts
- Robot control → STM32 HAL: initializes HAL
Core/Src/main.c - Robot control → I2C HAL: uses I2C
- STM32 HAL → STM32F103 registers: accesses registers
- STM32F103 registers → CMSIS core: uses core definitions