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

Mr-What:

terryking228:
I'm writing a library for these: http://goo.gl/FWMjI and I'd love to try some cool mapping ideas with your code...

I'm writing my own too. My test code is posted at http://arduino.cc/forum/index.php/topic,141363.0.html.
The big difference for my code is that an array of HC-SR04's all share the same trigger, then read pulse
time using pin-change interrupts (on mega).

It is kind of hard for me to generalize pin-change interrupts, so it is somewhat hard-coded.
more of an example than a good general-purpose library.

The problem with pin-change interrupts is that it's not even tested on the Uno, only Mega. It's a little ridged for a general-purpose library. The next release of NewPing should have a pin interrupt-based method. I've expanded my required compatibility to include the Uno, Teensy 2.0, and Teensy 3.0. So, it's a little more challenging at times.

I do have a question for you. How do you deal with pings that don't return? Waiting for the interrupt doesn't work as sometimes there isn't a ping return. I'm building an ultra-low-powered system currently and because I can't rely on getting a ping result, I can't do what I wanted, which is to put the ATmega to sleep while waiting for the pin interrupt. Still got it down to using only 1.27mA, but even lower would be better.

Tim