89
Basic Line Following Program
We will now discover how the line sensors will allow your Pi-Bot to detect and track a line.
Line following consists of two parts:
1.
Determining the position of your Pi-Bot to a black line
First, your Pi-Bot determines its position relative to a black line with the use of line sensors,
located in the front. When the line sensor detects black, sensor outputs “1” indicating that most
of the light is absorbed. When the line sensor detects white, the sensor output is “0.”
By using three line sensors, your Pi-Bot will know whether it is on a black line (left and right
sensors output “0” and the center sensor outputs “1”), to the left of a black line, or to the right
of a black line.
2.
Motor control
With this information, your Pi-Bot will control the speed of each motor individually to try and
get back over the line.
The diagram below visualizes parts 1 and 2.
Содержание Pi-Bot v2.00
Страница 67: ...67 Figure 6 15 ...
Страница 78: ...78 UltraSonicSensorTestwithLED Program ...
Страница 80: ...80 ObstacleAvoidance Program ...
Страница 82: ...82 ObstacleAvoidancewithLED Program ...
Страница 83: ...83 ObstacleAvoidancewithLED Program CONTINUED ...
Страница 90: ...90 Download and run the following program LineFollowing Program ...
Страница 91: ...91 LineFollowing Program CONTINUED ...
Страница 94: ...94 AdvancedLineFollowing Program CONTINUED ...
Страница 95: ...95 AdvancedLineFollowing Program CONTINUED ...
Страница 96: ...96 AdvancedLineFollowing Program CONTINUED ...
Страница 110: ...Appendix B Complete Pi Bot Wiring Schematic ...