Assistance for Ping Sensor
Hello:
I am a beginner in this world of robotics and sensors, and I have the following problem, for wich I would appreciate your opinion and solution:
I've been experimenting with the Ping Sensor connected to the Homework Board, as indicated in the brief instructions of the sensor.
For some reason that I cannot understand, the sensor functions correctly until is 14 cms appart from the wall. For greater distances the sensor shows always 14 cms, wit no variation.
Any suggestions???
Thanks in advance.
Keep walking.
I am a beginner in this world of robotics and sensors, and I have the following problem, for wich I would appreciate your opinion and solution:
I've been experimenting with the Ping Sensor connected to the Homework Board, as indicated in the brief instructions of the sensor.
For some reason that I cannot understand, the sensor functions correctly until is 14 cms appart from the wall. For greater distances the sensor shows always 14 cms, wit no variation.
Any suggestions???
Thanks in advance.
Keep walking.

Comments
The code for the PING operation that I am using is (same as the instructions):
' {$STAMP BS2}
' {$PBASIC 2.5}
time VAR Word
DO
PULSOUT 15, 5
PULSIN 15, 1, time
DEBUG HOME, "time = ", DEC5 time
time = time ** 2251
DEBUG CR, "Distancia =", DEC4 time, " cm"
PAUSE 100
LOOP
The wiring is also as the instructions.
Regards
Keep walking
Thank you in advance for any assistance.
dprbrts42
Did I miss something in the instructions?
Carl
' {$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 LOOPLooks like you have your math functions reversed.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen