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
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.
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.
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
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PG
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: