Shop OBEX P1 Docs P2 Docs Learn Events
need help with the ping range finder — Parallax Forums

need help with the ping range finder

teratera Posts: 2
edited 2007-04-08 05:29 in Robotics
if i have the range finder measuring distance in inches how do get it to trigger a buzzer or an led when an object is within a certain range?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-08 05:29
    You use an IF statement (see the PBasic manual) to test for a distance between specified bounds like
    if (dist < maxDist) and (dist > minDist) then
     ... do something ...
    endif
    


    The "do something" depends on what you want to do. Go through the "Whats a Microcontroller?" tutorial for discussions of how to control LEDs or buzzers with a Stamp. You can download the tutorial here: www.parallax.com/html_pages/edu/curriculum/sic_curriculum.asp along with other useful tutorials.
Sign In or Register to comment.