Shop OBEX P1 Docs P2 Docs Learn Events
Sonar sensors — Parallax Forums

Sonar sensors

StormKing09StormKing09 Posts: 29
edited 2009-02-18 23:57 in Accessories
Is there any way to incorporate a sonar sensor into a PBASIC program for a BASIC Stamp. This is mainly for the BS2 models such as the BS2, BS2sx, BS2p, BS2px and so forth. please reply if you can help

Comments

  • P!-RoP!-Ro Posts: 1,189
    edited 2009-02-16 04:04
    Of course. If you go to the parallax page for the ping sensor you can find plenty of downloads giving you information on·how to do it. Here's the link.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • StormKing09StormKing09 Posts: 29
    edited 2009-02-17 22:52
    Wow. Thanks alot.[noparse]:)[/noparse]
  • StormKing09StormKing09 Posts: 29
    edited 2009-02-17 23:22
    Also, does anyone know what the circuit diagram symbol would be for the PING))) sonar sensor? If you do, please let me know. tnx
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-17 23:39
    For complex devices like a PING))), there's usually not any specific symbol used on schematics. The general "black box" symbol used would be a rectangle of some sort with the name of the device included. There's no particular convention for the connections either, but, if there are only a few, they're usually placed on one side. Sometimes the power connections are placed on the "bottom" and the signal connections on one side. If you want to be creative, you could add arcs on one side to imply the sound wavefronts, but the PING))) is much more than just the ultrasonic transducers. There's a microcontroller and a driver / pre-amp.
  • StormKing09StormKing09 Posts: 29
    edited 2009-02-18 20:57
    Whaaaaat? Try speaking english dude. I don't gibrish.
  • StormKing09StormKing09 Posts: 29
    edited 2009-02-18 20:58
    also, I can't get the sample codes off of the internet. can someone type it into a thread post?
  • SRLMSRLM Posts: 5,045
    edited 2009-02-18 21:33
    TheFulcrum22 said...
    Whaaaaat? Try speaking english dude. I don't gibrish.

    Generally, some respect for others is helpful. A better answer might be "I'm sorry, but could you simplify that for a beginner? Thank you." Basically, what Mike is saying is that you'll want to use a box with the name PING))) in it. He gives some general placement of pins on the schematic.

    Here's some example ping code:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    ' Conversion constants for room temperature measurements.
    CmConstant    CON   2260
    InConstant    CON   890
    
    cmDistance  VAR   Word
    inDistance  VAR   Word
    time        VAR   Word
    
    DO
      PULSOUT 15, 5
      PULSIN 15, 1, time
    
      cmDistance = cmConstant ** time
      inDistance = inConstant ** time
    
      DEBUG HOME, DEC3 cmDistance, " cm"
      DEBUG CR, DEC3 inDistance, " in"
    
      PAUSE 100
    LOOP
    
    
  • StormKing09StormKing09 Posts: 29
    edited 2009-02-18 23:21
    Tnx. Sorry 'bout that.
  • StormKing09StormKing09 Posts: 29
    edited 2009-02-18 23:24
    Can you give me some more examples plz. if so, tnx.
  • SRLMSRLM Posts: 5,045
    edited 2009-02-18 23:33
    They're all available on the product page. I'm guessing that, for some reason, you have a download restriction. You'll want to find a way around that.
  • StormKing09StormKing09 Posts: 29
    edited 2009-02-18 23:57
    Good guess
Sign In or Register to comment.