which calculations for these values?

Thanks for the good project. ]]>

pulseIn(echoPin, HIGH) will return the time it takes for the sound to reach the object and be returned, which is 2 x the distance, so we divide by 2.

Then to convert the timing into a familiar metric we divide by 29 to get centimeters, or we can divide by 74 to get inches.

I hope that helps. I’ll see if I can explain this better in the article.

Thanks for your feedback!

]]>