Line follower algorithm
From cod3v
Introduction
The easiest line follower algorithm is Zig Zag algorithm, which goes like zig zag and never straight. However, it is funny to observe the movements of the robot, and test the meaning of the different parameters.
Aim
If block (programming). Color.
Robot
Almost any robot will do, but this example is done using Asimov 2/ Verne.
Sensors
The color sensor is used to read the color.
Example Video
Theory
Example Code
Exercises
- Use the other side of the line to follow the line
- Make the robot to change the side of the line during the line following: Thus, after following the line e.g. 2 wheel rotations, use the other side of the line
- Make a robot with two color sensors, and use the information from the other sensor to stop the robot when the other sensor recognizes black line.
- Make a robot with two color sensors, and make the robot to follow a line that is in between the two sensors.
- Make a robot with two color sensors, and make the robot to follow first the line with left sensor, then after two wheel rotations use the other sensor to follow the line to the end.
Back to Mahtavaa Matematiikkaa 2020