TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 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 (136977 times)
  2. FAT32 Library (70091 times)
  3. Network Ethernet Library (56023 times)
  4. USB Device Library (46343 times)
  5. Network WiFi Library (41959 times)
  6. FT800 Library (41274 times)
  7. GSM click (29051 times)
  8. mikroSDK (26488 times)
  9. PID Library (26447 times)
  10. microSD click (25411 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

6DOF IMU 22 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.2

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 19 times

Not followed.

License: MIT license  

6DOF IMU 22 Click is a compact add-on board for advanced motion tracking. This board features the ICM-42670-P, a high-performance 6-axis MEMS MotionTracking IMU from TDK InvenSense. The ICM-42670-P integrates a 3-axis gyroscope and accelerometer, offering exceptional precision in motion detection. It supports both I2C and SPI interfaces for communication, features a substantial 2.25Kbytes FIFO, and includes two programmable interrupts that enhance power efficiency through a wake-on-motion feature.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "6DOF IMU 22 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "6DOF IMU 22 click" changes.

Do you want to report abuse regarding "6DOF IMU 22 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


6DOF IMU 22 click

6DOF IMU 22 Click is a compact add-on board for advanced motion tracking. This board features the ICM-42670-P, a high-performance 6-axis MEMS MotionTracking IMU from TDK InvenSense. The ICM-42670-P integrates a 3-axis gyroscope and accelerometer, offering exceptional precision in motion detection. It supports both I2C and SPI interfaces for communication, features a substantial 2.25Kbytes FIFO, and includes two programmable interrupts that enhance power efficiency through a wake-on-motion feature.

6dofimu22_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Nov 2023.
  • Type : I2C/SPI type

Software Support

We provide a library for the 6DOF IMU 22 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 6DOF IMU 22 Click driver.

Standard key functions :

  • c6dofimu22_cfg_setup Config Object Initialization function.

    void c6dofimu22_cfg_setup ( c6dofimu22_cfg_t *cfg );
  • c6dofimu22_init Initialization function.

    err_t c6dofimu22_init ( c6dofimu22_t *ctx, c6dofimu22_cfg_t *cfg );
  • c6dofimu22_default_cfg Click Default Configuration function.

    err_t c6dofimu22_default_cfg ( c6dofimu22_t *ctx );

Example key functions :

  • c6dofimu22_read_data This function reads the accelerometer, gyroscope, and temperature measurement data.

    err_t c6dofimu22_read_data ( c6dofimu22_t *ctx, c6dofimu22_data_t *data_out );
  • c6dofimu22_get_int1_pin This function returns the INT1 pin logic state.

    uint8_t c6dofimu22_get_int1_pin ( c6dofimu22_t *ctx );
  • c6dofimu22_clear_data_ready This function clears the data ready interrupt by reading the INT_STATUS_DRDY register.

    err_t c6dofimu22_clear_data_ready ( c6dofimu22_t *ctx );

Example Description

This example demonstrates the use of 6DOF IMU 22 click board by reading and displaying the accelerometer and gyroscope data (X, Y, and Z axis) as well as a temperature measurement in degrees Celsius.

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. */
    c6dofimu22_cfg_t c6dofimu22_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.
    c6dofimu22_cfg_setup( &c6dofimu22_cfg );
    C6DOFIMU22_MAP_MIKROBUS( c6dofimu22_cfg, MIKROBUS_1 );
    err_t init_flag = c6dofimu22_init( &c6dofimu22, &c6dofimu22_cfg );
    if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( C6DOFIMU22_ERROR == c6dofimu22_default_cfg ( &c6dofimu22 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

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

Application Task

Waits for a data ready indication and then reads the accelerometer, gyroscope, and temperature measurements. The results are displayed on the USB UART every 80ms as per the accel and gyro output data rate which is set to 12.5 Hz.

void application_task ( void )
{
    static c6dofimu22_data_t meas_data;
    if ( !c6dofimu22_get_int1_pin ( &c6dofimu22 ) )
    {
        c6dofimu22_clear_data_ready ( &c6dofimu22 );
        if ( C6DOFIMU22_OK == c6dofimu22_read_data ( &c6dofimu22, &meas_data ) )
        {
            log_printf ( &logger, " Accel X: %.2f g\r\n", meas_data.accel.x );
            log_printf ( &logger, " Accel Y: %.2f g\r\n", meas_data.accel.y );
            log_printf ( &logger, " Accel Z: %.2f g\r\n", meas_data.accel.z );
            log_printf ( &logger, " Gyro X: %.1f dps\r\n", meas_data.gyro.x );
            log_printf ( &logger, " Gyro Y: %.1f dps\r\n", meas_data.gyro.y );
            log_printf ( &logger, " Gyro Z: %.1f dps\r\n", meas_data.gyro.z );
            log_printf ( &logger, " Temperature: %.2f C\r\n\n", meas_data.temperature );
        }
    }
}

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.6DOFIMU22

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

ECG GSR Click

0

ECG GSR click is a complete solution for PPG, ECG and GSR application development, utilizing a specialized IC with a clinical-grade analog front-end (AFE) and electrical front-end. ECG GSR click uses the AS7030B IC, an ultra-low power, multi-channel bio-sensor, which features a wide range of different options, making it an ideal solution for development of blood oxygen level, heart rate and galvanic skin response monitoring applications, fitness applications, for the ECG bio-authentication, and similar applications related to heart monitoring. ECG GSR click is also equipped with the 3.5mm electrodes connectors, making it ready to be used out of the box.

[Learn More]

GSR click

0

GSR click can be used to measure the electrodermal activity (EDA) of the human body, also known as the galvanic skin response (GSR).

[Learn More]

TouchPad 3 click

5

Touchpad 3 Click is a compact add-on board that allows users to easily integrate projected capacitive touch into their applications.

[Learn More]