Shop OBEX P1 Docs P2 Docs Learn Events
Programming the PING sensor help — Parallax Forums

Programming the PING sensor help

RonzemRonzem Posts: 1
edited 2008-01-28 15:54 in BASIC Stamp
Where are 3 friends that bought a Boebot and the ping sensor for it, Our plan was that the boebot should run forward until the ping sensor detects an object within 10 cm, and then it should turn around 90 degrees and then run forward again, until it get's 10 cm close to an object, and then turns around....

We been working on this for some weeks now but we can't get it to work, How do we do this? what's the code to use.

We want something like this:

Ping sensor detects the object and shows that it's 00010cm away from it

so...

IF Distance 00010 THEN
Pulsout 13, 750 (for the wheels to move)

something like that...Can anyone help us program the ping sensor to do this?
Thanks.

Comments

  • edited 2008-01-28 15:36
    The Stamps in Class "Mini Projects" thread has some Boe-Bot + Ping))) navigation examples that make the Boe-Bot go to an object and stop right in front of it. You could probably either adapt relevant portions of the example code to your project or modify the program so that it accomplishes your goal. Here's a link to Stamps in Class "Mini Projects":

    http://forums.parallax.com/forums/default.aspx?f=6&m=98784

    Note: If you don't have a standard servo to sweep the Ping))) back and forth, just modify the example code to make the Boe-Bot turn back and forth instead.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andy Lindsay

    Education Department
    Parallax, Inc.
  • FranklinFranklin Posts: 4,747
    edited 2008-01-28 15:54
    Also do a search for 'roaming with ping' I think there are some programs already out there for this. Have fun.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.