User Manual
52
When the sensor detects the black line is at the centre-left, the RollFlash will turn left slightly;
when it is at the centre-right, the robot should turn right a bit; when the line is in the middle,
the RollFlash would move forward. That’s how it works for line following. Besides, it needs to
detect whether there're obstacles and avoid them if yes.
The program above is about detecting whether there's an obstacle 6cm in front of the
RollFlash by the ultrasonic module. If it detects an obstacle, it will walk away from the
obstacle, and then walk back to follow the line. Thus, we can realize the line following &
obstacle avoiding.
SunFounder