you can also increase accuracy by adding air temperature measurement ,
to correct sound speed in the air... you can earn any % of accuracy..
Code:
// Via la mesure de temperature LM35DZ en °C
// reajuste la vitesse son dans l'air f(Temperature)
// y = 0,5803x + 328,39
Sound_Speed= Filtered_Temp *0.5803 + 328.39;
fltToa (Sound_Speed, ValFt2,1); // 1 decimale
k=fprintf(_H_USART,(Flash_Mem *)"Vs=%s;",ValFt2);
but , written with C18 MPLAB.. with Pick18F26K22 ...
So it's just the formula to use...
you must add ADC measure for LM35DZ 0 to 50°C .. no measure in Alaska !
and use the new air sound speed for distance calculation..
i will try to translate it in MikroC for 16F8x7 and gives feed back to this post..