In the tutorial ,it is said that for reading a pulse ,we have to use pulse in command pulsepin(pin,high).The doubt which I am having is that ,is the high pulse generated by return wave or is it set to high and then pulled downby the return wave.
Reads a pulse (either HIGH or LOW) on a pin. For example, if value is HIGH, pulseIn() waits for the pin to go HIGH, starts timing, then waits for the pin to go LOW and stops timing. Returns the length of the pulse in microseconds.
The Ping sensor has two horns. One yells, the other listens. When the listening one hears the echo from the yelling horn, it writes the Ping sensor wire high for a duration equal to the time it took the yell to return to the sensor.
The Arduino sketch outputs a pulse that activates the yelling horn and then quickly switches to input and collects the duration of the pulse the listening horn sends. After that, it is math.