Quote:
Originally Posted by hzheng_449
I'm assuming you're using something like the vex ultrasonic sensor (otherwise you should be able to treat an ultrasonic like any other sensor).
In this case, I believe that the pingChannel is the PWM out pin that goes into the input wire and the echoChannel is the analog channel you read the final value on.
|
If he is in fact referring to the vex one, or the venerable
HS-SR04, then the genreal process is to sent a 10 microsecond pulse on the trigger and then get the width of the pulse sent back out on the echo pin (both digital). The width of that response pulse is proportional to the distance.