Converting IR value to distance