Vision Line Following (Hiwonder 7.6)
In Hiwonder 7.6, the robot uses the ESP32-S3 vision module to detect a red wide line and moves along it.
Instead of using IR line sensors, the camera is doing the “line detection”, and the Arduino uses that detection output to steer.
The camera detects where the line is in the image. Your controller compares that position to the center. The difference (error) becomes a steering correction.
// Example structure (concept) readLineData(buffer); lineX = buffer[0]; targetX = IMAGE_WIDTH / 2; error = targetX - lineX; set_angle = kP * error; set_speed = baseSpeed; Velocity_Controller(set_angle, set_speed, 0, SIMULATE_PWM_CONTROL);