proxfusion2  2.0.0.0
Main Page

ProxFusion 2 click

ProxFusion® 2 Click is an ambient lighting, capacitive, Hall-effect, and inductive sensing Click board™ which features a single multifunctional sensor IC.

click Product page


Click library

Software Support

We provide a library for the ProxFusion2 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 ProxFusion2 Click driver.

Standard key functions :

Example key functions :

Examples Description

This example demontrates the use of ProxFusion 2 Click board.

The demo application is composed of two sections :

Application Init

Initializes and configures the sensor.

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.
PROXFUSION2_MAP_MIKROBUS( cfg, MIKROBUS_1 );
proxfusion2_init( &proxfusion2, &cfg );
proxfusion2_default_cfg( &proxfusion2 );
}

Application Task

Checks whether Touch is detected and measures the output detection. Measures Ambient lighting - whether it's Light or Dark, ALS range and ALS output. Checks the orientation of the magnet and measures the HALL output.

void application_task ( void )
{
// Task implementation.
log_printf( &logger, "\n_________________________________________________________________________\n");
log_printf( &logger, "\n| TOUCH | T - UI | AMBIENT | ALS RANGE | ALS UI | HALL | HALL UI |\n");
touch = proxfusion2_read_byte( &proxfusion2 , 0x13);
if ((touch & 0x02) != 0)
{
log_printf( &logger, "| YES |");
}
else
{
log_printf( &logger, "| NO |");
}
log_printf( &logger, "%d |", data_read);
dark_light_ambient = proxfusion2_detect_dark_light( &proxfusion2, &als_range);
if (dark_light_ambient == PROXFUSION2_DARK_AMBIENT )
{
log_printf( &logger, " DARK |");
}
else
{
log_printf( &logger, " LIGHT |");
}
log_printf( &logger, "%d |", als_range);
data_read = proxfusion2_read_data( &proxfusion2, PROXFUSION2_ALS_UI_OUTPUT );
log_printf( &logger, "%d |", data_read);
hall_detect = proxfusion2_detect_hall( &proxfusion2 );
if (hall_detect != 0)
{
if( hall_detect == 1 )
{
log_printf( &logger, "NORTH |");
}
else
{
log_printf( &logger, "SOUTH |");
}
}
log_printf( &logger, "%d |", data_read);
Delay_ms( 3000 );
}

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.