TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139242 times)
  2. FAT32 Library (71742 times)
  3. Network Ethernet Library (57115 times)
  4. USB Device Library (47428 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28072 times)
  9. PID Library (26885 times)
  10. microSD click (26198 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

Cap Touch 4 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.2

mikroSDK Library: 2.0.0.0

Category: Capacitive

Downloaded: 13 times

Not followed.

License: MIT license  

Cap Touch 4 Click is a compact add-on board for wake-on-touch and activation applications. This board features the IQS211B, a single-channel capacitive controller from Azoteq, featuring ProxSense® technology for highly sensitive self-capacitance measurements. The board includes a defined circular touch-sensing area, signal conditioning for parasitic capacitance, and a low-power Sleep mode with wake-up functionality, ensuring efficient energy consumption. It communicates via the I2C interface with a fixed address of 0x47, operates at 3.3V logic, and features the new Click Snap for added flexibility.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Cap Touch 4 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Cap Touch 4 Click" changes.

Do you want to report abuse regarding "Cap Touch 4 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Cap Touch 4 Click

Cap Touch 4 Click is a compact add-on board for wake-on-touch and activation applications. This board features the IQS211B, a single-channel capacitive controller from Azoteq, featuring ProxSense® technology for highly sensitive self-capacitance measurements. The board includes a defined circular touch-sensing area, signal conditioning for parasitic capacitance, and a low-power Sleep mode with wake-up functionality, ensuring efficient energy consumption. It communicates via the I2C interface with a fixed address of 0x47, operates at 3.3V logic, and features the new Click Snap for added flexibility.

captouch4_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Apr 2024.
  • Type : I2C type

Software Support

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

Standard key functions :

  • captouch4_cfg_setup Config Object Initialization function.

    void captouch4_cfg_setup ( captouch4_cfg_t *cfg );
  • captouch4_init Initialization function.

    err_t captouch4_init ( captouch4_t *ctx, captouch4_cfg_t *cfg );
  • captouch4_default_cfg Click Default Configuration function.

    err_t captouch4_default_cfg ( captouch4_t *ctx );

Example key functions :

  • captouch4_read_system_flags This function reads the system flags register.

    err_t captouch4_read_system_flags ( captouch4_t *ctx, uint8_t *sysflags );
  • captouch4_read_cap_counts This function reads the counts number directly proportional to capacitance. The system is calibrated to make the counts as sensitive as possible to changes in capacitance for relative measurements.

    err_t captouch4_read_cap_counts ( captouch4_t *ctx, uint16_t *cap_counts );
  • captouch4_read_lta This function reads the long-term averate (LTA) value. The LTA is used as reference to compare with capacitance counts.

    err_t captouch4_read_lta ( captouch4_t *ctx, uint16_t *lta );

Example Description

This example demonstrates the use of Cap Touch 4 Click board by reading the proximity, touch, and movement events.

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. */
    captouch4_cfg_t captouch4_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.
    captouch4_cfg_setup( &captouch4_cfg );
    CAPTOUCH4_MAP_MIKROBUS( captouch4_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == captouch4_init( &captouch4, &captouch4_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( CAPTOUCH4_ERROR == captouch4_default_cfg ( &captouch4 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

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

Application Task

Reads the proximity, touch, and movement events and approximately displays the results on the USB UART every 200ms. The capacitance counts and the long-term average values are also displayed.

void application_task ( void )
{
    uint8_t sys_flags = 0;
    uint8_t movement = 0;
    uint16_t cap_counts = 0;
    uint16_t lta = 0;
    if ( CAPTOUCH4_OK == captouch4_read_system_flags ( &captouch4, &sys_flags ) )
    {
        if ( sys_flags & CAPTOUCH4_SYSFLAGS0_PROX )
        {
            log_printf( &logger, " Proximity detected\r\n" );
        }
        if ( sys_flags & CAPTOUCH4_SYSFLAGS0_TOUCH )
        {
            log_printf( &logger, " Touch detected\r\n" );
        }
        if ( sys_flags & CAPTOUCH4_SYSFLAGS0_MOVEMENT )
        {
            if ( CAPTOUCH4_OK == captouch4_read_movement ( &captouch4, &movement ) )
            {
                log_printf( &logger, " Movement detected: %u\r\n", ( uint16_t ) movement );
            }
        }
        if ( ( sys_flags & CAPTOUCH4_SYSFLAGS0_MOVEMENT ) || 
             ( sys_flags & CAPTOUCH4_SYSFLAGS0_PROX ) || 
             ( sys_flags & CAPTOUCH4_SYSFLAGS0_TOUCH ) )
        {
            if ( CAPTOUCH4_OK == captouch4_read_cap_counts ( &captouch4, &cap_counts ) )
            {
                log_printf( &logger, " Capacitance counts: %u\r\n", cap_counts );
            }
            if ( CAPTOUCH4_OK == captouch4_read_lta ( &captouch4, &lta ) )
            {
                log_printf( &logger, " Long-term average: %u\r\n\n", lta );
            }
        }
        else
        {
            log_printf( &logger, " No detected events\r\n\n" );
        }
    }
    Delay_ms ( 200 );
}

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

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

SRAM 3 Click

0

SRAM 3 Click is a compact add-on board that contains a serial non-volatile SRAM with a high storage capacity. This board features the ANV32AA1WDK66, a 1Mb serial SRAM with a non-volatile SONOS storage element included with each memory cell organized as 128k words of 8 bits each from Anvo-System Dresden. The serial SRAM provides fast access & cycle times, high data accuracy, ease of use, and unlimited read & write accessed by a high-speed SPI compatible bus. This Click board™ is suitable to store drive profiles, configurations, and similar data, or for applications such as medical devices, industrial automation (for example, motor control and robotics), smart metering systems, and many others.

[Learn More]

WiFi 6 click library

1

WiFi 6 click is a mikroBUS add-on board whose functionality is determined by two components: a WF121-A Wi-Fi module for communication over 2.4GHz band with excellent performance, and a PIC32MX695H MCU for end user applications to be embedded onto the click board itself.

[Learn More]

Water Detect 2 Click

0

Water Detect 2 Click is a compact add-on board that can detect the presence/flow of a liquid in a clear tube. This board features the OPB350L250, a tube liquid sensor from TT Electronics. Water Detect 2 Click has multiple output states and can recognize fluid present, no fluid present, and no tube present. This sensor excepts 1/4” tubing (6.3mm) as an outside diameter of the clear tubes, regardless of the direction of the liquid’s flow.

[Learn More]