Hi there,
I pretty sure the code there, does exactly that, It’s “zero” ?
I would try the Tool and see where that takes it. Also verify the connections and orientation, I see several folks have it upside down, LOL
GL PJ
(continued) 10 minutes later…
I had one of these NIB, popped it open and soldered the sockets to it, mounted a
Xiao ESP32C3 to it, Went to google play and down loaded the Radar app.
Super easy I turned on Bluetooth on my phone(sam10+) it scanned and found the unit.
I setup a ruler and a mini test, WOW!. I was surprised how well it worked and how accurate it became the longer I left it on.(see the pics)
They do work well, Note I have NOT updated it firmware wise. ( I see some issues with that)
I’ll use it as is, and test more moving to the PC app and see what that yields. Then to Real Code
I’m not sure what app is on the Xiao it’s connected to but it’s only providing power at this point , which I feel is a good starting point for anyone having one of these and struggling.
I hit connect and Instantly it was connected and reading

With a curved top , I got the end measurements and with a flat top, It hit it Exactly at 46cm
WithOut the Top it measures the Distance to the ceiling 200+cm LOL

HTH
GL PJ
Ps. You may want to edit the post Title and include the part in Question, That would really be helpful to ALL, better for you and better for searching.