SharpIR icon indicating copy to clipboard operation
SharpIR copied to clipboard

Get the distance with decimals

Open IonicaBizau opened this issue 3 years ago • 3 comments

Thanks a lot for this wonderful module! Is it possible to get the distance as a double value? I assume I would just have to change that in the library, to replace int with double.

IonicaBizau avatar Dec 23 '21 16:12 IonicaBizau

replacing the int(s) with double(s) should do the trick :)

cybeaer avatar Dec 24 '21 00:12 cybeaer

I'd like to read in mm resolution. I replaced int(s) with double(s), the resolution still remains in cm.

smileymoody avatar Feb 05 '22 04:02 smileymoody

I'd like to read in mm resolution. I replaced int(s) with double(s), the resolution still remains in cm.

Just multiply it by 10, because there is 10 mm in 1 cm

You can either do this in the library in SharpIR::distance(), or you can do it on the result you get from SharpIR.distance()

If this does not give the desired precision, you could try to tweak some of the numbers in SharpIR::distance()

marvhus avatar Sep 19 '22 10:09 marvhus