0

Line Robot - Basic lessons - Exercises - Around obstacle

Another task from RCJ Rescue Line competition.

Task: go around an obstacle on line.

Put an obstacle on line and program Your robot to go around it. After finding the black line behind the obstacle, and stepping on it, stop the robot. Use the program we made before, which stops the robot in front of an obstacle on line:

void RobotLine::loop() {
	if (line(5))
		go(10, 80);
	else if (line(3))
		go(80, 10);
	else
		go(60, 60);

	if (frontLeft() < 60)
		end();
}