Skip to main content

Program Flow

Basic Workflow:

Firmware is present in affbotics_software/firmware/avg/Line_sensor/src/main.cpp

  • Line sensor communicates using Modbus over RS485
  • The Modbus I registers from address 0X1000 to 0X1003 can be read to obtain number of tracks, markers, Left track error and Right track error

Am a Geek:

  • Modbus Register address and SLAVE_ID can be changed by changing #define values
  • Uncomment the line  #define DEBUGMODE 1 to continuously print raw sensor readings in CSV format through serial.
  • Track and marker threshold values can be tweaked by changing #define trackThreshold and #define markerThreshold