Follow a line
<languages/> <translate>
Introduction
There a multiple different methods (algorithms) to follow a line. We show two simplest methods (which can be coded with a huge variety), also zig zag linefollower and proportional line follower. See the linked pages for more references.
Robot
Any robot (with tires or treads, perhaps walking robots too) will work.
Sensors
One light sensor or color sensor is needed.
Example Videos
Theory
These algorithms follow the border of the line, not the line.
Calibration
The color sensor should be calibrated, either in the program using black and light reflectances, or by calibrating the values from the sensor. See the linked page for more information.
Zig Zag
Zig zag algorithm turns to right if sees white, and to left if the sensor is on the black. Or vice versa. The algorithm is easy to program using only one if block. The speed and turning value need to be considered and adjusted.
Proportional
$$f=ma$$

Example Code
Exercises
This course is supported by Meet and Code. The course is made in collaboration with Robotiikka- ja tiedekasvatus ry.

</translate>