I have the SRF05 right next to me , running the code I posted here, and it works fine..
The example with the distances you gave, means that the SRF05 doesn't actually work.
Now, I can only assume three obvious things:
- The SRF05 is damaged
- Your cables and your connections are bad
- Software problem
Solutions I may think of, providing the SRF05 is not damaged:
- Check your cables; also check the connections again.Use only one Mode ( either SRF04 Compatibility or SFR05) and make sure you have all connected properly
Can you tell us what mode you use and the pin connections of your SRF05 and Arduino?
- I don't think you have a software problem, but to elliminate that possibilty, you can try all this on a Windows running computer.
teoxan