TOP Contributors

  1. MIKROE (2782 codes)
  2. Alcides Ramos (377 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 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 (139598 times)
  2. FAT32 Library (72044 times)
  3. Network Ethernet Library (57272 times)
  4. USB Device Library (47636 times)
  5. Network WiFi Library (43232 times)
  6. FT800 Library (42570 times)
  7. GSM click (29933 times)
  8. mikroSDK (28315 times)
  9. PID Library (26939 times)
  10. microSD click (26312 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 16 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.5

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 98 times

Not followed.

License: MIT license  

6DOF IMU 16 Click is a compact add-on board with a 6-axis inertial measurement device. This board features the ICM-42605, a premium performance 6-axis MotionTracking™ IMU from TDK InvenSense. It combines a 3-axis gyroscope and a 3-axis accelerometer, supporting the lowest gyroscope and accelerometer sensor noise in this IMU class. It also has the highest stability against temperature, shock, SMT/bend-induced offset, and more.

No Abuse Reported

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

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

Do you want to report abuse regarding "6DOF IMU 16 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


6DOF IMU 16 Click

6DOF IMU 16 Click is a compact add-on board with a 6-axis inertial measurement device. This board features the ICM-42605, a premium performance 6-axis MotionTracking™ IMU from TDK InvenSense. It combines a 3-axis gyroscope and a 3-axis accelerometer, supporting the lowest gyroscope and accelerometer sensor noise in this IMU class. It also has the highest stability against temperature, shock, SMT/bend-induced offset, and more.

6dofimu16_click.png

Click Product page


Click library

  • Author : Stefan Ilic
  • Date : Dec 2023.
  • Type : I2C/SPI type

Software Support

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

Standard key functions :

  • c6dofimu16_cfg_setup Config Object Initialization function.

    void c6dofimu16_cfg_setup ( c6dofimu16_cfg_t *cfg );
  • c6dofimu16_init Initialization function.

    err_t c6dofimu16_init ( c6dofimu16_t *ctx, c6dofimu16_cfg_t *cfg );
  • c6dofimu16_default_cfg Click Default Configuration function.

    err_t c6dofimu16_default_cfg ( c6dofimu16_t *ctx );

Example key functions :

  • c6dofimu16_sw_reset This function performs the device software reset.

    err_t c6dofimu16_sw_reset ( c6dofimu16_t *ctx );
  • c6dofimu16_get_gyro_data This function reads the angular rate of X, Y, and Z axis in degrees per second (mdps).

    err_t c6dofimu16_get_gyro_data ( c6dofimu16_t *ctx, c6dofimu16_axis_t *gyro_data );
  • c6dofimu16_get_accel_data This function reads the accelerometer of X, Y, and Z axis relative to standard gravity (mg).

    err_t c6dofimu16_get_accel_data ( c6dofimu16_t *ctx, c6dofimu16_axis_t *accel_data );

Example Description

This example demonstrates the use of 6DOF IMU 16 Click board by reading and displaying the accelerometer and gyroscope data (X, Y, and Z axis).

The demo application is composed of two sections :

Application Init

Initializes the driver performs the Click default configuration, and checks communication by reading device ID.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    c6dofimu16_cfg_t c6dofimu16_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.
    c6dofimu16_cfg_setup( &c6dofimu16_cfg );
    C6DOFIMU16_MAP_MIKROBUS( c6dofimu16_cfg, MIKROBUS_1 );
    err_t init_flag = c6dofimu16_init( &c6dofimu16, &c6dofimu16_cfg );
    if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( C6DOFIMU16_ERROR == c6dofimu16_default_cfg ( &c6dofimu16 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    uint8_t dev_id = 0;
    c6dofimu16_reg_read( &c6dofimu16, C6DOFIMU16_REG_WHO_AM_I, &dev_id );
    if ( C6DOFIMU16_DEVICE_ID != dev_id )
    {
        log_error( &logger, " Communication error " );
        for ( ; ; );
    }
    log_printf( &logger, " Device ID: 0x%.2X \r\n", ( uint16_t ) dev_id );


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

Application Task

Reading the accelerometer and gyroscope measurements, results are displayed on the USB UART every second.

void application_task ( void )
{
    c6dofimu16_axis_t accel_data;
    c6dofimu16_axis_t gyro_data;

    c6dofimu16_get_accel_data( &c6dofimu16, &accel_data );
    c6dofimu16_get_gyro_data( &c6dofimu16, &gyro_data );
    log_printf( &logger, " Accel data | Gyro data \r\n" );
    log_printf( &logger, " X: %.2f g  | %.2f dps \r\n", accel_data.x_data, gyro_data.x_data );
    log_printf( &logger, " Y: %.2f g  | %.2f dps \r\n", accel_data.y_data, gyro_data.y_data );
    log_printf( &logger, " Z: %.2f g  | %.2f dps \r\n", accel_data.z_data, gyro_data.z_data );
    Delay_ms ( 1000 );
}

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

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

3D Hall click

1

3D Hall click carries the MLX90333 Triaxisâ„¢ Hall sensor, capable of detecting the position of any magnet in nearby space. It does so by being sensitive to three components of flux density (BX, BY, BZ). The board communicates with the target MCU through the mikroBUS SPI interface. 3D Hall click is designed to use a 5V power supply only.

[Learn More]

AC Current click

6

AC Current click can measure alternating currents up to 30A and it features the MCP3201 ADC (analog to digital) converter and the MCP607 CMOS Op Amp, both from Microchip. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target MCU over an SPI interface, and the AN pin on the mikroBUS line.

[Learn More]

Temp-Log 7 Click

0

Temp-Log 7 Click is a compact add-on board used to measure and record the temperature of an environment over time. This board features the TMP1826, a high-accuracy, 1-Wire® compatible digital output temperature sensor from Texas Instruments with integrated 2-kbit EEPROM. It supports a wide operating temperature range from –20°C to +85°C with its high accuracy of ±0.1°C (typical)/±0.3°C (maximum) and comes with a factory-programmed 64-bit unique identification number for addressing and NIST traceability. Besides a programmable alarm function that outputs an interrupt signal to the MCU when a specific temperature event occurs, it also has three digital I/O pins configurable for general purposes or to identify the device's position on a shared bus.

[Learn More]