NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.7

teckel:
You're right, that would be all that's required to read a LOW pulse instead of a HIGH pulse. It's a little more complicated as it waits and makes sure the signal is LOW before it times the HIGH pulse. But, it's still shooting in the dark without the sensor in front of me.

You can try the following changes to NewPing.cpp, which just changes the pulse measurement from HIGH to LOW:

	while (!(*_echoInput & _echoBit))                   // Wait for the ping echo.
	while (!(*_echoInput & _echoBit) && micros() <= _max_time) {} // Wait for echo pin to clear.
while (*_echoInput & _echoBit)                                // Wait for ping to start.





if (*_echoInput & _echoBit) {    // Ping echo received.




Tim

Dear Tim,

I made the changes to the suggested codes and it WORKS on the URM37 using the Examples codes...

I'm using Pin4 for PWM & Pin5 for Trigger...

I also tried with TWO sensors and it is still working without any delays between reading the sensors...

Let me capture a scope output and post it here later...

Thanks a lot!!!

Stanley