MakeBlock - Line Follower
To use the line following sensor so that the robot can follow a black line and correct itself when it goes off track. The line follower uses light to detect a black line on the surface below the robot. It has two sensors, one on the left and one on the right. When both detect a black line, they return a value of 0 to the the robot. When the left side does not detect black, the sensor shows a value of 1, when the right side does not detect black, the sensor shows a value of two. When both sensors do not detect black a value of 3 is sent to the robot.
- Connect the line-following sensor to port 9 on the robot.
- Copy the sample code. Test the sample code on the Ranger Test Pad.
- Figure out what is wrong with the code. Fix it so that it will track the line the entire way around.