TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136870 times)
  2. FAT32 Library (70000 times)
  3. Network Ethernet Library (55999 times)
  4. USB Device Library (46301 times)
  5. Network WiFi Library (41908 times)
  6. FT800 Library (41206 times)
  7. GSM click (29012 times)
  8. PID Library (26423 times)
  9. mikroSDK (26394 times)
  10. microSD click (25385 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

IR Gesture 2 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.10

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 63 times

Not followed.

License: MIT license  

IR Gesture 2 Click is a compact add-on board that provides contactless gesture recognition. This board features the MAX25405, a data-acquisition system for the gesture and proximity sensing from Analog Devices. Detection distance is improved by integrating a complete optical system with a lens, aperture, visible light filter, and a 6x10 photodetector array. The proximity, hand detection, and gesture recognition functions of the MAX25405 operate by detecting the light reflected from the controlled IR-LED light sources driven directly from the MAX25405. It can also detect these gestures even when exposed to bright ambient light and process data from the sensor through an SPI interface.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "IR Gesture 2 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "IR Gesture 2 click" changes.

Do you want to report abuse regarding "IR Gesture 2 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


IR Gesture 2 click

IR Gesture 2 Click is a compact add-on board that provides contactless gesture recognition. This board features the MAX25405, a data-acquisition system for the gesture and proximity sensing from Analog Devices. Detection distance is improved by integrating a complete optical system with a lens, aperture, visible light filter, and a 6x10 photodetector array. The proximity, hand detection, and gesture recognition functions of the MAX25405 operate by detecting the light reflected from the controlled IR-LED light sources driven directly from the MAX25405. It can also detect these gestures even when exposed to bright ambient light and process data from the sensor through an SPI interface.

irgesture2_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Apr 2022.
  • Type : SPI type

Software Support

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

Standard key functions :

  • irgesture2_cfg_setup Config Object Initialization function.

    void irgesture2_cfg_setup ( irgesture2_cfg_t *cfg );
  • irgesture2_init Initialization function.

    err_t irgesture2_init ( irgesture2_t *ctx, irgesture2_cfg_t *cfg );
  • irgesture2_default_cfg Click Default Configuration function.

    err_t irgesture2_default_cfg ( irgesture2_t *ctx );

Example key functions :

  • irgesture2_get_int_pin This function returns the INT pin logic state.

    uint8_t irgesture2_get_int_pin ( irgesture2_t *ctx );
  • irgesture2_read_pixels This function reads the raw ADC values of entire 60-pixel IR photodiode array.

    err_t irgesture2_read_pixels ( irgesture2_t *ctx, int16_t *pixels, bool flip_pixels );
  • irgesture2_write_register This function writes a data byte to the selected register by using SPI serial interface.

    err_t irgesture2_write_register ( irgesture2_t *ctx, uint8_t reg, uint8_t data_in );

Example Description

This example demonstrates the use of IR Gesture 2 click board by reading and displaying the raw ADC values of entire 60-pixel IR photodiode array.

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;  /**< Logger config object. */
    irgesture2_cfg_t irgesture2_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    irgesture2_cfg_setup( &irgesture2_cfg );
    IRGESTURE2_MAP_MIKROBUS( irgesture2_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == irgesture2_init( &irgesture2, &irgesture2_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( IRGESTURE2_ERROR == irgesture2_default_cfg ( &irgesture2 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

Application Task

Waits for an end of conversion interrupt and then reads the raw ADC values of entire 60-pixel IR photodiode array and displays the results on the USB UART as a 10x6 matrix every 100ms approximately.

void application_task ( void )
{
    // Wait for an end of conversion interrupt
    while ( irgesture2_get_int_pin ( &irgesture2 ) );

    int16_t pixels[ IRGESTURE2_NUM_SENSOR_PIXELS ];
    if ( IRGESTURE2_OK == irgesture2_read_pixels ( &irgesture2, pixels, false ) )
    {
        for ( uint8_t cnt = 0; cnt < IRGESTURE2_NUM_SENSOR_PIXELS; cnt++ )
        {
            if ( 0 == ( cnt % IRGESTURE2_SENSOR_X_SIZE ) )
            {
                log_printf( &logger, "\r\n" );
            }
            log_printf( &logger, "%d\t", pixels[ cnt ] );
        }
        log_printf( &logger, "\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.IRGesture2

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.


ALSO FROM THIS AUTHOR

Qi Receiver click

0

Qi Receiver click is based on the P9025AC 5W Qi wireless power receiver integrated circuit, with the advanced Foreign Object Detection (FOD) feature, from IDT. The click utilizes the principles of the inductive coupling for the purpose of wireless power transfer.

[Learn More]

Tilt 2 click

0

Tilt 2 click is a tilt sensor switch, which breaks the circuit when tilted to an angle of 45° or when shaken. It is a single-pole-double-throw type of switch (SPDT), which can be operated with up to 24V.

[Learn More]

Accel 30 click

0

Accel 30 Click is a compact add-on board that contains an acceleration sensor. This board features the MC3635, an ultra-low power, low-noise, integrated digital output 3-axis accelerometer from MEMSIC. The MC3635 allows selectable full-scale acceleration measurements in ranges of ±2g, ±4g, ±8g, ±12g, or ±16g in three axes with a configurable host interface that supports both SPI and I2C serial communication. It also supports high-resolution, low-power operating modes and interrupt feature for various events allowing maximum flexibility to meet multiple use case needs.

[Learn More]