proximity6  2.0.0.0
Main Page

Proximity 6 click

Proximity 6 click is a versatile proximity detection device on a Click boardâ„¢.

click Product page


Click library

Software Support

We provide a library for the Proximity6 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Proximity6 Click driver.

Standard key functions :

Example key functions :

Examples Description

This application can detect the proximity of an object via sensor and can show the results of proximity as a graphic view, or show the position of the object.

The demo application is composed of two sections :

Application Init

Sets the registers in default state and configures the device to work in proper operating mode (Proximity Mode).

void application_init ( void )
{
log_cfg_t log_cfg;
// Logger initialization.
log_cfg.level = LOG_LEVEL_DEBUG;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "-|--|- Application Init -|--|-" );
// Click initialization.
PROXIMITY6_MAP_MIKROBUS( cfg, MIKROBUS_1 );
proximity6_init( &proximity6, &cfg );
Delay_ms( 300 );
proximity6_default_cfg( &proximity6 );
proximity6_load_settings( &proximity6 );
log_printf( &logger, "Proximity 6 is initialized\r\n\r\n");
Delay_ms( 300 );
}

Application Task

Example can show the data register values as graphic view in desired resolution. Also can determine from which side the object (body) affects on the sensor and logs results on USB UART. Results will be shown only when one or more data registers are updated with the new value (sensor detects the change).

void application_task ( void )
{
// Task implementation.
}

Note

void proximity6_logGraphicRes() - Function loggs on USB UART results from the data proximity registers as graphic view. void proximity6_logPositionRes() - Function loggs on USB UART the position of the object which affects of the sensor.

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

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. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.