Lidar Lite V2 having decimals output?

I have been trying the new Lidar Lite V2 for distance calculation. I have use the distance code provided by the Pulse Light. However, I will wish to have a more accurate reading. Thus, I'm wondering is anyone have a decimal output programme?

#include <Wire.h>
#include <LIDARLite.h>

LIDARLite myLidarLite;

void setup() {
  Serial.begin(115200);
  myLidarLite.begin();
  myLidarLite.beginContinuous();
  pinMode(3, INPUT);
}

void loop() {
  if(!digitalRead(3)){
    Serial.println(myLidarLite.distanceContinuous());
    delay(100);
    
  }
}

The accuracy of the Lidar Lite V2 is +/- 2.5 cm. This could in principle be increased if you average a number of measurements together.

What distance units do you intend to use, and what should the decimal places represent?

jremington:
The accuracy of the Lidar Lite V2 is +/- 2.5 cm. This could in principle be increased if you average a number of measurements together.

What distance units do you intend to use, and what should the decimal places represent?

Hihi

I'm trying to use it as a mapping tools,thus, I wish it to be as precise as possible. The measuring unit i used is in CM.

Then you have no need for any digits after the decimal point. Such digits would be entirely fictitious.

Printing an integer distance is already more precise than allowed by the device specification.

Conduct your own tests with the device, for various distances that you have carefully measured with an accurate measuring tape, and you will understand.

jremington:
Then you have no need for any digits after the decimal point. Such digits would be entirely fictitious.

Printing an integer distance is already more precise than allowed by the device specification.

Conduct your own tests with the device, for various distances that you have carefully measured with an accurate measuring tape, and you will understand.

Thank you so much!! :slight_smile: