Distance Sensor

In this code snippet we have the distance sensor set up on pins 13 and 14

and an LED on pin 3. If the distance is less than 6cm then the LED turns on.