You've now learned enough to make a simple robot. Its purpose is to always be looking at the closest object. OK, it's not the most exciting robot, but it's a great demo of how you can combine what you've learned about the PWM and ADC subsystems.
For this, you will need:
Wire up the circuit on your breadboard, as shown in the figure:
The Sharp IR proximity sensor contains an infrared LED, an infrared detector, and some circuitry to drive them. The detector measures the amount of infrared light that is reflected back from whatever ...