Hi all of you.
I have 2 HC-SR04 ultra sonic module like below.
my library works correctly with module No 1 and not works with No2 in B4R.
my library always return 0 in module No2.
Does anyone have a library for this type of module?
On a slight tangent: do you have two modules to provide "stereo" operation?
As in, if you transmit using module 1, do *both* modules 1 & 2 both receive the echo (likely offset slightly by time)? Or does a module only start receiving *after* it has done a transmit?
How accurate does the distance measurement need to be?
If your Arduino isn't too busy, it might be simpler taking readings with a software polling loop and a Delay(1). Sound travels around 30 cm in 1 ms, and divide that by two for the round trip, so you'd be getting readings in the order of +/- 15 cm.
Or if you were willing to time and rely on your Arduino's empty polling loop rate, then +/- 1 cm looks plausible.