This is header file for Lidar-lite-v3 for Atmega328p. For other microcontrollers, changing registers name will work.
WORKING PRINCIPLE USING MODE CONTROL PIN:
The mode control pin is shorted with rec_bit on microcontroller and mode control pin is connected to trig_bit through 1k resistor. When the trig_bit is made low, the LIDAR acknowledges by sending LASER and pulling up the mode control pin and hence the rec_bit.
when the LASER returns back i.e. when obstacle is detected near, the mode control pin becomes low.
HOW TO PROGRAM?
- clear the trig_bit to send LASER through LIDAR.
- wait until the trig_bit is low.
- start timer.
- wait until the trig_bit is high. (i.e obstacle is detected)
- stop the timer.
- calculate the distance , given that the the LASER travels 1cm in 10us.