I am trying to get the last distance used in the velocity calculations as seen in page 44 in pdf. Also having the issue getting a stable velocity and distance. For the distance I also I am providing the Arduino code.

code: http://1drv.ms/1OgnWbO

http://lidarlite.com/docs/v2/pdf/LIDAR-Lite-v1-docs.pdf