Skip to content

Latest commit

 

History

History

garmin_lite

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Garmin lite

The Garmin / PulsedLight LIDAR-Lite rangefinder is a low-cost optical distance measurement solution with a 40m range under most operating conditions, low power consumption, and small form factor.

drawing

Reference Datasheet
Requred periphery I2C
Unit tests test_garmin_lite.cpp

Usage

Installation:

  1. Include the header file garmin_lite.h and source file garmin_lite.c in your C/C++ code.
  2. Ensure that the required dependencies are installed, such as the STM32 HAL library or any other libraries specific to your STM32 development environment.

Usage:

  1. During the boot of your application initialize I2C driver and then call garminLiteInit()
  2. Periodically (with rate 10 Hz) call garminLiteCollectData(). If it returns LIBPERIPH_OK, then call garminLiteParseCollectedData().

Implementation details

The simplest method of obtaining measurement results from the I2C interface is as follows:

  1. Write 0x04 to register 0x00
  2. Read register 0x01. Repeat until bit 0 (LSB) goes low
  3. Read two bytes from 0x8f (0x0f and 0x10) to obtain 16-bit measured distance in centimeters.

Slightly optimized algorithm:

  1. Read two bytes from 0x8f (0x0f and 0x10) to obtain 16-bit measured distance in centimeters
  2. Write 0x04 to register 0x00

Additional info