SharpIR
SharpIR copied to clipboard
Get the distance with decimals
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
.
replacing the int(s) with double(s) should do the trick :)
I'd like to read in mm resolution. I replaced int(s) with double(s), the resolution still remains in cm.
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()