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

fairorgan:
Fantastic job with this new library!

I am especially liking the median feature of v1.5 to eliminate rogue results, but how can this be integrated into the 15 sensor example sketch which does not use ping() but sonar.ping_timer(function) instead?

To actually combine the two would be simple. However, in the process it would lose the interrupt aspect of the ping_timer() method. I've been toying with the idea, and considering new ways of doing it. One thing I've considered is a mass ping of all sensors at the same time followed by interrupt waiting for the ping echo. With 15 sensors there could be crazy cross-talk. But with 4 sensors it would probably work.

Also consider that with 15 sensors, if it were to poll each sensor 3 times it would take 3 times as long. Not sure how much processing time you have left after pinging 15 sensors. But, multiply the time it takes by 3 or 5 and you may no longer have time to do anything else, or the pings are just too slow to sense something in time if your robot is moving at a high enough speed.

Tim