You cod find an libary to do it(some compilers allready have them built in).
As for the LCD you can use an small char. LCD in 4 bit mode so it dosent take up much pins (since you dont have much I/O on this PIC)
agen you can get libarys to do it (allmost all high level compilers have such libarys built in)
the sound travels at about 340 m/s so if it takes 1s to get it back the object is 170 m
distance = time / 2 * 340
distance is in meters and time is in seconds
The air temperature and humidity can afect the speed of sound so if you meshure big distances this can afect the result.But you have it only for max of 10 m wich isent going to be afected.
You may want to add or substarct someting from the time if you are geting delays in your code that make the result unacurete.
Sice your using an PIC this caculaton cod esaly be exsexuted in it fast
Hehe, yeah, just factor out the 2 :wink: . But I thought of this, it could work... 10x Guys!!! I'll try 2 get my components and hope they work :roll: ...