LidarLite 3V with Arduino Nano Relay Control


I am working on a project setting up a LidarLite 3V to activate a relay at a predetermined distance. I have constructed several sketches that will compile but my understanding of the Lidar input value is lacking. Being connected via I2C where/how does one interpret the distance in order to activate a simple relay? The following code was the last “wild hair” reach at triggering the relay but it will reflect the premise of what I am attempting to achieve. The Lidar unit is working perfectly with this code, as mentioned before it does compile with no errors on the Arduino IDE.

#include <Wire.h>
#include <LIDARLite.h>
#define SLAVE_ADDRESS 0x0f
LIDARLite lidar3v;
int reading = SLAVE_ADDRESS;

int relayCH1 = 11;

void setup()

  pinMode(relayCH1, OUTPUT);



void loop()

  int distance = reading;


      if (distance <= 50) {
        digitalWrite(11, HIGH);
      } else {
        digitalWrite(11, LOW);


I am not asking for anyone to write the code for me, just need to understand how/where the distance value from a lidar unit is usable inside the program. Is it from an 0xXX address, digitalRead, analogRead? I have tried many combinations.

Thank you for your time,


All is well now, found a solution. A special “Thank You” to everyone that was considering assisting me on this.