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

terryking228:
Tim, This is an approach that could perhaps be taken more often with libraries in general: Expose relevant internal (previously private) variables for the user who wishes to do additional calculations.

Maybe the library could even be structured so that if a user does that, the code for further/final calculations in the "usual" application is not compiled?

I'm still semi-illiterate about library details and conventions so this is just conjecture.

Terry, that's exactly how I see it. I think the primary goal of the NewPing library is to measure the ping/echo time and distance as easily, quickly and accurately as possible. But, when we get into advanced distance conversion, the requirement to consider temperature and to a lesser extent humidity take it outside the scope of an ultrasonic/ping library as other sensors are required. For those with this need, the NewPing library provides the user with the low-level ping/echo timing. And those with this need and knowledge of what other sensors are needed should already know the equation they need to use.

Not that I'm going to wash my hands of this and off-load it. There's just more primary issues, like making pulseIn event-driven and a generally more accurate echo time sensor first.

Tim