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

fred_dot_u:
In the process of searching for the HC-SR04 in the forum, this thread has popped up as the most useful resource. I've downloaded the library and run the demo code which works just fine unmodified. One strange aspect is that when it's uploaded to my Uno (1.0), the first measurement appears valid, while all others run to zero. If I press the reset button, all is good until next code upload.

Should I jump to the newer version for my device and if so, what complications can I expect?

There's no compatibility issues with moving to the latest version of the library. There's also some bug fixes in the later releases so I would highly suggest upgrading.

My guess is that something else is going wrong, however, as the demo code works but your code is not working correctly. There's no obvious reason that I can think of that would explain your situation. So, the best bet is if the latest version of the library still doesn't work, you should post your code source so others or myself can see what the problem is. I have an Uno and it's one of the platforms I use for testing (I also have a Teensy 2.0). I really only test with Arduino v1.0. I have Arduino 0023 on only one of my development machines and all I really do with 0023 is load the demo to make sure it works.

Tim