irgesture3  2.1.0.0
Main Page

IR Gesture 3 click

IR Gesture 3 Click is a compact add-on board that provides contactless gesture recognition. This board features the ADPD1080, a photometric front-end from Analog Devices. The IR Gesture 3 Click allows gesture recognition in two dimensions, with a built-in optical filter and a sharp visible light cutoff. It eliminates the need for external lenses and preserves the dynamic range of the sensor when placed under sunlight or indoor lighting. It does not require a precise alignment because its sensor maintains a linear response within the ±35° angular field of view.

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Mar 2023.
  • Type : I2C type

Software Support

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

Standard key functions :

Example key functions :

Example Description

This example demonstrates the use of IR Gesture 3 click board by processing the incoming gestures and displaying them on the USB UART.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the click default configuration.

void application_init ( void )
{
log_cfg_t log_cfg;
irgesture3_cfg_t irgesture3_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
irgesture3_cfg_setup( &irgesture3_cfg );
IRGESTURE3_MAP_MIKROBUS( irgesture3_cfg, MIKROBUS_1 );
if ( I2C_MASTER_ERROR == irgesture3_init( &irgesture3, &irgesture3_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( IRGESTURE3_ERROR == irgesture3_default_cfg ( &irgesture3 ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}

Application Task

Reads and processes all the incoming gestures and displays them on the USB UART.

void application_task ( void )
{
uint8_t gesture = 0;
if ( IRGESTURE3_OK == irgesture3_get_gesture ( &irgesture3, &gesture ) )
{
log_printf( &logger, "\r\n Gesture: " );
switch ( gesture )
{
{
log_printf( &logger, "CLICK\r\n" );
break;
}
{
log_printf( &logger, "SWIPE UP\r\n" );
break;
}
{
log_printf( &logger, "SWIPE DOWN\r\n" );
break;
}
{
log_printf( &logger, "SWIPE LEFT\r\n" );
break;
}
{
log_printf( &logger, "SWIPE RIGHT\r\n" );
break;
}
default:
{
log_printf( &logger, "UNKNOWN\r\n" );
break;
}
}
}
else
{
log_printf( &logger, "\r\n No gesture detected!\r\n" );
}
}

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.IRGesture3

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.


irgesture3_t
IR Gesture 3 Click context object.
Definition: irgesture3.h:441
irgesture3_init
err_t irgesture3_init(irgesture3_t *ctx, irgesture3_cfg_t *cfg)
IR Gesture 3 initialization function.
IRGESTURE3_GESTURE_SWIPE_DOWN
#define IRGESTURE3_GESTURE_SWIPE_DOWN
Definition: irgesture3.h:380
irgesture3_set_adc_fsample
err_t irgesture3_set_adc_fsample(irgesture3_t *ctx, uint16_t freq_hz)
IR Gesture 3 set adc fsample function.
application_task
void application_task(void)
Definition: main.c:64
irgesture3_get_gesture
err_t irgesture3_get_gesture(irgesture3_t *ctx, uint8_t *gesture)
IR Gesture 3 get gesture function.
irgesture3_set_mode
err_t irgesture3_set_mode(irgesture3_t *ctx, uint8_t mode)
IR Gesture 3 set mode function.
IRGESTURE3_MAP_MIKROBUS
#define IRGESTURE3_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition: irgesture3.h:414
IRGESTURE3_ERROR
@ IRGESTURE3_ERROR
Definition: irgesture3.h:478
IRGESTURE3_GESTURE_SWIPE_UP
#define IRGESTURE3_GESTURE_SWIPE_UP
Definition: irgesture3.h:379
IRGESTURE3_GESTURE_SWIPE_RIGHT
#define IRGESTURE3_GESTURE_SWIPE_RIGHT
Definition: irgesture3.h:382
irgesture3_cfg_t
IR Gesture 3 Click configuration object.
Definition: irgesture3.h:459
irgesture3_default_cfg
err_t irgesture3_default_cfg(irgesture3_t *ctx)
IR Gesture 3 default configuration function.
application_init
void application_init(void)
Definition: main.c:28
irgesture3_cfg_setup
void irgesture3_cfg_setup(irgesture3_cfg_t *cfg)
IR Gesture 3 configuration object setup function.
IRGESTURE3_OK
@ IRGESTURE3_OK
Definition: irgesture3.h:477
IRGESTURE3_GESTURE_CLICK
#define IRGESTURE3_GESTURE_CLICK
Definition: irgesture3.h:378
IRGESTURE3_GESTURE_SWIPE_LEFT
#define IRGESTURE3_GESTURE_SWIPE_LEFT
Definition: irgesture3.h:381