LightRanger 11 click
LightRanger 11 Click is a compact add-on board suitable for range-finding and distance-sensing applications. This board features the VL53L7CX, a time-of-flight 8x8 multizone ranging sensor from STMicroelectronics. It is a fast and accurate multizone distance-ranging sensor width of 90° wide FoV. The multizone-ranging output with either 4x4 or 8x8 separate zones, width multitarget detection, and distance measurement in each zone. As a multizone-ranging device, its range is only up to 350cm.
click Product page
Click library
- Author : Nenad Filipovic
- Date : Aug 2023.
- Type : I2C type
Software Support
We provide a library for the LightRanger 11 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for LightRanger 11 Click driver.
Standard key functions :
lightranger11_cfg_setup
Config Object Initialization function.
void lightranger11_cfg_setup(lightranger11_cfg_t *cfg)
LightRanger 11 configuration object setup function.
LightRanger 11 Click configuration object.
Definition lightranger11.h:236
lightranger11_init
Initialization function.
err_t lightranger11_init(lightranger11_t *ctx, lightranger11_cfg_t *cfg)
LightRanger 11 initialization function.
LightRanger 11 Click context object.
Definition lightranger11.h:206
lightranger11_default_cfg
Click Default Configuration function.
err_t lightranger11_default_cfg(lightranger11_t *ctx)
LightRanger 11 default configuration function.
Example key functions :
lightranger11_get_ranging_data
LightRanger 11 get ranging data function.
err_t lightranger11_get_ranging_data(lightranger11_t *ctx, lightranger11_results_data_t *results)
LightRanger 11 get ranging data function.
LightRanger 11 Click block header union data definition.
Definition lightranger11.h:254
lightranger11_get_resolution
LightRanger 11 get resolution function.
err_t lightranger11_get_resolution(lightranger11_t *ctx, uint8_t *resolution)
LightRanger 11 get resolution function.
lightranger11_get_int_pin
LightRanger 11 get int pin function.
uint8_t lightranger11_get_int_pin(lightranger11_t *ctx)
LightRanger 11 get int pin function.
Example Description
This example demonstrates the use of LightRanger 11 click board by reading and displaying 8x8 zones measurements on the USB UART.
The demo application is composed of two sections :
Application Init
Initializes the driver and performs the click default configuration.
{
log_cfg_t log_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define LIGHTRANGER11_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition lightranger11.h:191
@ LIGHTRANGER11_ERROR
Definition lightranger11.h:276
void application_init(void)
Definition main.c:29
Application Task
Reads all zone measurements approximately every 500ms and logs them to the USB UART as an 8x8 map. The silicon temperature measurement in degrees Celsius is also displayed.
{
{
uint8_t resolution, map_side;
{
log_printf ( &logger, "\r\n %ux%u MAP (mm):\r\n", ( uint16_t ) map_side, ( uint16_t ) map_side );
for ( uint16_t cnt = 1; cnt <= resolution; cnt++ )
{
log_printf ( &logger,
" %u\t", results.
distance_mm[ cnt - 1 ] );
if ( 0 == ( cnt % map_side ) )
{
log_printf ( &logger, "\r\n" );
}
}
log_printf ( &logger,
" Silicon temperature : %d degC\r\n", ( int16_t ) results.
silicon_temp_degc );
}
}
}
#define LIGHTRANGER11_RESOLUTION_4X4
LightRanger 11 resolution setting.
Definition lightranger11.h:122
@ LIGHTRANGER11_OK
Definition lightranger11.h:275
void application_task(void)
Definition main.c:65
int8_t silicon_temp_degc
Definition lightranger11.h:256
int16_t distance_mm[64]
Definition lightranger11.h:262
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.LightRanger11
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.