distance measurement average and sound speed correction

change to measure the distance and correct it
with the speed of sound in air with temperature correction