TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 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 (137094 times)
  2. FAT32 Library (70236 times)
  3. Network Ethernet Library (56120 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42069 times)
  6. FT800 Library (41384 times)
  7. GSM click (29111 times)
  8. mikroSDK (26561 times)
  9. PID Library (26489 times)
  10. microSD click (25486 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 4 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.15

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 145 times

Not followed.

License: MIT license  

6DOF IMU 4 Click is an advanced 6-axis motion tracking Click board™, which utilizes the ICM-20602, a high-performance integrated motion sensor, equipped with a 3-axis gyroscope, and a 3-axis accelerometer.

No Abuse Reported

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

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

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

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


c6DOF IMU 4 click

6DOF IMU 4 Click is an advanced 6-axis motion tracking Click board™, which utilizes the ICM-20602, a high-performance integrated motion sensor, equipped with a 3-axis gyroscope and a 3-axis accelerometer.

6dofimu4_click.png

click Product page


Click library

  • Author : MikroE Team
  • Date : Dec 2019.
  • Type : I2C/SPI type

Software Support

We provide a library for the c6DofImu4 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for c6DofImu4 Click driver.

Standard key functions :

  • Config Object Initialization function.

    void c6dofimu4_cfg_setup ( c6dofimu4_cfg_t *cfg );

  • Initialization function.

    C6DOFIMU4_RETVAL c6dofimu4_init ( c6dofimu4_t ctx, c6dofimu4_cfg_t cfg );

  • Click Default Configuration function.

    void c6dofimu4_default_cfg ( c6dofimu4_t *ctx );

Example key functions :

  • Sync Pin Setting function

    void c6dofimu4_set_sync_pin ( c6dofimu4_t *ctx, uint8_t state );

  • Data Get function

    void c6dofimu4_get_data ( c6dofimu4_t ctx, c6dofimu4_axis_t accel_out, c6dofimu4_axis_t gyro_out, int8_t temp_out );

  • Full Scale Setting function

    uint8_t c6dofimu4_set_fsr ( c6dofimu4_t *ctx, uint8_t gyro_resol, uint8_t accel_resol );

Examples Description

This application measures gyroscopic, accelerometer, and temperature data.

The demo application is composed of two sections :

Application Init

Initializes I2C interface and performs a device reset and configurations.


void application_init ( void )
{
    log_cfg_t log_cfg;
    c6dofimu4_cfg_t cfg;

    /** 
     * 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.

    c6dofimu4_cfg_setup( &cfg );
    C6DOFIMU4_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    c6dofimu4_init( &c6dofimu4, &cfg );
    c6dofimu4_reset( &c6dofimu4 );

    c6dofimu4_default_cfg( &c6dofimu4 );
    Delay_ms ( 200 );

    log_printf( &logger, "** 6DOF IMU 4 is initialized **\r\n" );
}

Application Task

Waits until data is ready and then reads the all data registers, accelerometer, gyroscope and temperature data, and shows results to the uart terminal every 500ms.


void application_task ( void )
{
    c6dofimu4_axis_t  accel_data;
    c6dofimu4_axis_t  gyro_data;
    uint8_t data_ready;
    int8_t temperature;

    data_ready = c6dofimu4_get_status( &c6dofimu4, C6DOFIMU4_DATA_RDY_INT_MASK );

    while ( data_ready != C6DOFIMU4_DATA_RDY_INT_OCCURED )
    {
        data_ready = c6dofimu4_get_status( &c6dofimu4, C6DOFIMU4_DATA_RDY_INT_MASK );
    }

    c6dofimu4_get_data( &c6dofimu4, &accel_data, &gyro_data, &temperature );

    log_printf( &logger,"** Accelerometer values :\r\n" );
    log_printf( &logger, "* X-axis : %.2lf g ", accel_data.x );
    log_printf( &logger, "* Y-axis : %.2lf g ", accel_data.y );
    log_printf( &logger, "* Z-axis : %.2lf g ", accel_data.z );
    log_printf( &logger,"\r\n" );

    log_printf( &logger,"** Gyroscope values :\r\n" );
    log_printf( &logger, "* X-axis : %.2lf dps ", gyro_data.x );
    log_printf( &logger, "* Y-axis : %.2lf dps ", gyro_data.y );
    log_printf( &logger, "* Z-axis : %.2lf dps ", gyro_data.z );
    log_printf( &logger,"\r\n" );

    log_printf( &logger, "** Temperature value : %d C\r\n", temperature );
    log_printf( &logger,"------------------------------------------------- \r\n" );

    Delay_ms ( 500 );
}

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.6DofImu4

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. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


ALSO FROM THIS AUTHOR

LR 10 click

0

LR 10 Click is a compact add-on board designed for the Internet of Things (IoT) applications requiring low power consumption and long-range connectivity. This board features the Wio-E5, a LoRa wireless module from Seeed Technology. The Wio-E5 integrates the STM32WLE5JC system-level chip and the SX126X LoRa® chip alongside an Arm® Cortex® M4 MCU, ensuring ultra-low power usage and high performance. It supports multi-mode operations, including (G)FSK and LoRa®, and can operate across a frequency range of 868 to 928MHz with robust signal strength and sensitivity. These characteristics make the LR 10 Click ideal for various IoT scenarios, such as wireless sensor networks, remote meter readings, and other applications with crucial low-power, wide-area network connectivity.

[Learn More]

EEPROM 6 click

5

EEPROM 6 Click is a compact add-on board that contains a serial EEPROM memory that operates from the 1-Wire interface. This board features the DS28EC20, a 20480-bit EEPROM organized as 80 memory pages of 256 bits each from Maxim Integrated.

[Learn More]

Opto 3 click

5

Opto 3 click is a relay Click boardâ„¢, equipped with two pairs of optically isolated solid-state relays (SSR).

[Learn More]