Sonar
Hardware
Obstacle Detection using a Sonar
Write a program that compute the distance (in cm) to an obstacle in front of the sonar. If no obstacle is in front, the program does nothing. Use the plotter tool to display a graph.
RGB LED to Report Obstacles
Use an RGB blinking LED to signal obstacles. The LED status should be:
- green = no obstacle
- blinking yellow = obstacle but far enough (you should find the right distance)
- red = close obstacle