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

Only a day has passed and I've gone a totally different direction with the new multiple ping (digital filter) method. Come to find out, the algorithm I was focusing on yesterday was missing something. Once added, the code size went up over 100 bytes. Because of this, I threw out the code and switched to a more advanced digital filtering. The new algorithm saves the ping results in an array, insertion sorts the array, ignoring the NO_ECHOs finds the median, and finally calculates the mean from results within 4cm of the median.

It's a more effective digital filter and the code is tight. I'm working on making it even better by trying to implement an online median algorithm which would eliminate the need to sort (although the insertion sort currently being used is also an online algorithm and extremely small).

Still tweaking and testing (shaved 44 bites from the compiled code while I was writing this post).

Tim