How Ping))) Works
This might be something really easy for some of you but I'm confused with the coding part for the ping)) sensor.
Can you please tell me where these values come from:
Where the 5 and 1 come from, what are those values, I got this info from the ping)) pdf file from parallax. This is a example program. I know that 15 is the pin that the ultrasound is connected to.
But what about 5 and 1?????????????
DO
PULSOUT 15, 5
PULSIN 15, 1, time
cmDistance = cmConstant ** time
inDistance = inConstant ** time
............
loop
I will really appreciate your help. Thanks in advance.
Can you please tell me where these values come from:
Where the 5 and 1 come from, what are those values, I got this info from the ping)) pdf file from parallax. This is a example program. I know that 15 is the pin that the ultrasound is connected to.
But what about 5 and 1?????????????
DO
PULSOUT 15, 5
PULSIN 15, 1, time
cmDistance = cmConstant ** time
inDistance = inConstant ** time
............
loop
I will really appreciate your help. Thanks in advance.
Comments
In the pulsout command, the 5 is the length of the pulse. Look at the command in the manual.
In the pulsin statement, the 1 is the start condition of the pulse. Look at the command in the manual.
Make sure to note that the length of the pulsout depends on which flavor of Stamp you are using.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
So what difference is gonna make if I change those values.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Thannks men.