user10543: Hey I just started using arduino and so far can't get any help with how to write a code for an led to turn on when someone gets in range of a three pin ultrasonic sensor, and off when they are out of a specific range.
Any help?

user7856: Try with this and check that at least you can reproduce the desired effect:
http://www.arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor
Then you can refer to this for the part related to driving the LED:
http://www.arduino.cc/en/Tutorial/Blink?from=Tutorial.BlinkingLED
Since the ultra sound demo already calculates the distance, you can do the test on that to decide when to turn ON/OFF the LED.

10543: <p>Hey I just started using arduino and so far can't get any help with how to write a code for an led to turn on when someone gets in range of a three pin ultrasonic sensor, and off when they are out of a specific range.</p>

<p>Any help?</p>
 7856: <p>Try with this and check that at least you can reproduce the desired effect:
<a href="http://www.arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor" rel="nofollow">http://www.arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor</a></p>

<p>Then you can refer to this for the part related to driving the LED:
<a href="http://www.arduino.cc/en/Tutorial/Blink?from=Tutorial.BlinkingLED" rel="nofollow">http://www.arduino.cc/en/Tutorial/Blink?from=Tutorial.BlinkingLED</a></p>

<p>Since the ultra sound demo already calculates the distance, you can do the test on that to decide when to turn ON/OFF the LED.</p>
