You could save yourself a lot of time, heartache and coding efforts by using one of the commercially available ultrasonic rangers that outputs a pre-calulated measurement (in inches or cm) down to 1 cm accuracy for less than $25. The one I have had a lot of success with is the SRF02 (see this URL: http://www.robotshop.com/srf02-ultra...m_campaign=jos. I have been very impressed with the performance of this device, but it does have one idiosyncracy when using an I2C bus to communicate with it.
If you decide to use this product, let me know and I can share some PBP code with you that has been pre-tested to work with the SRF02.
Bookmarks