Pipe OD measuring with KY-008 Laser transmitter & reciver module

I've been thinking alot of your design. Thank you btw, how would the code be written for this setup?