|
Using the optical sensors is rather easy to follow the line on the ground. All you need is 2 optical sensors. 3 would be more fail-safe and would allow you to travel at a faster speed.
Basically, just mount the optical sensors fairly close to eachother so that they can hit the tape when the tape is between them. Testing will be needed to be done to determine the best "gap" between the sensors. Mount them facing the ground so that one is on the right side of the line, and one is on the left.
Then, basically program your robot to move at reduced speed. Program it to do this:
if right_sensor_senses AND left_sensor_doesn't_sense:
turn_left
if right_sensor_doesn't_sense AND left_sensor_senses:
turn_right
else (otherwise)
move_both_wheels_same_speed
Basically, the robot will turn, while still going straight, and follow the line if one sensor can't see anything, until both do. Do do the last part as an "if" statement.
This is the most basic way of programming the robot to follow the line. It allows the robot to still move while seeking out the line.
__________________
The best moments of our lives fall in two categories: those that did happen and those that did not.
|