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

v1.3 will remove the loop counting timing method from NewPing. I've found that the compiler optimizes the compiled code with inconsistent results. Sometimes the loop is 17 instructions, other times it's 25 instructions, without changing the loop code. I tried to nail it down, but it kept drifting all over the place every time I made a change to the code (even well outside the loop). I'm also worried about different Arduino hardware also changing the the number of instructions in the loops at compile time. I use Teensy hardware, and while it seemed to match the loop instructions with the Arduino Uno, I just no longer trust that it will the next time I compile, or if compiled for different hardware.

The goal all along was to only have one timer, I included both in v1.2 because I wasn't sure which would end up being best. And to be honest, the loop counting method could never be made event-driven, so it's days were always numbered as making NewPing totally event driven is one of my primary goals. And, now that the loop counting code is gone, that's exactly what I'm going to focus on, making NewPing event-driven. Also, building event-driven 2 and 3 sensor array functions in NewPing. Finally, a hybrid ping/servo scanner that incorporates the event-driven NewPing with event-driven servo control for fast and fluid scanning while still freeing up the ATmega to do other things.

Tim