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 (137101 times)
  2. FAT32 Library (70236 times)
  3. Network Ethernet Library (56126 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42077 times)
  6. FT800 Library (41388 times)
  7. GSM click (29116 times)
  8. mikroSDK (26562 times)
  9. PID Library (26499 times)
  10. microSD click (25487 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 13 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.12

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 79 times

Not followed.

License: MIT license  

6DOF IMU 13 Click is a compact add-on board that contains an eCompass that consists of a 3-axis linear accelerometer and a 3-axis magnetic field sensor. This board features the MC6470, an accelerometer and magnetometer for a 6 DoF (6 Degrees of Freedom) sensor solution, from mCube Inc.

No Abuse Reported

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

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

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

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


6DOF IMU 13 click

6DOF IMU 13 Click is a compact add-on board that contains an eCompass that consists of a 3-axis linear accelerometer and a 3-axis magnetic field sensor. This board features the MC6470, an accelerometer and magnetometer for a 6 DoF (6 Degrees of Freedom) sensor solution, from mCube Inc.

6dofimu13_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : May 2021.
  • Type : I2C type

Software Support

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

Standard key functions :

  • c6dofimu13_cfg_setup Config Object Initialization function.

    void c6dofimu13_cfg_setup ( c6dofimu13_cfg_t *cfg );
  • c6dofimu13_init Initialization function.

    C6DOFIMU13_RETVAL c6dofimu13_init ( c6dofimu13_t *ctx, c6dofimu13_cfg_t *cfg );
  • c6dofimu13_default_cfg Click Default Configuration function.

    void c6dofimu13_default_cfg ( c6dofimu13_t *ctx );

Example key functions :

  • c6dofimu13_mag_get_data This function reads magnetometer X, Y, and Z-Axis data.

    err_t c6dofimu13_mag_get_data ( c6dofimu13_t *ctx, float *mag_x, float *mag_y, float *mag_z );
  • c6dofimu13_accel_init This function initializes accelerometer.

    err_t c6dofimu13_accel_init ( c6dofimu13_t *ctx, uint8_t samp_rate, uint8_t samp_range, uint8_t samp_res );
  • c6dofimu13_accel_get_data This function reads accelerometer X, Y, and Z-Axis data.

    err_t c6dofimu13_accel_get_data ( c6dofimu13_t *ctx, float *accel_x, float *accel_y, float *accel_z );

Example Description

This example demonstrates the use of 6DOF IMU 13 click board.

The demo application is composed of two sections :

Application Init

Initializes the driver, and sets the device default configuration.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    c6dofimu13_cfg_t c6dofimu13_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 );
    Delay_ms ( 100 );

    log_info( &logger, " Application Init " );

    // Click initialization.

    c6dofimu13_cfg_setup( &c6dofimu13_cfg );
    C6DOFIMU13_MAP_MIKROBUS( c6dofimu13_cfg, MIKROBUS_1 );
    err_t init_flag = c6dofimu13_init( &c6dofimu13, &c6dofimu13_cfg );
    if ( init_flag == I2C_MASTER_ERROR ) 
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

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

Application Task

Measures acceleration and magnetometer data and displays the results on the USB UART every second.


void application_task ( void )
{
    float acc_x, acc_y, acc_z;
    float mag_x, mag_y, mag_z;

    c6dofimu13_accel_get_data( &c6dofimu13, &acc_x, &acc_y, &acc_z );
    c6dofimu13_mag_get_data( &c6dofimu13, &mag_x, &mag_y, &mag_z );

    log_printf( &logger, " Accel X: %.3f g\t Mag X: %.2f uT\r\n", acc_x, mag_x );
    log_printf( &logger, " Accel Y: %.3f g\t Mag Y: %.2f uT\r\n", acc_y, mag_y );
    log_printf( &logger, " Accel Z: %.3f g\t Mag Z: %.2f uT\r\n", acc_z, mag_z );
    log_printf( &logger, "----------------------------------\r\n");

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

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

H-Bridge 10 click

0

H-Bridge 10 Click is a compact add-on board containing H-bridge outputs that let you control a DC motor to go backward or forward. This board features the MP6523, a triple, half-bridge, DMOS, output driver with integrated power MOSFETs that can drive up to three different loads from Monolithic Power Systems (MPS). The MP6523 is rated for an operating voltage range from 7V to 28V. It is SPI-configurable and has various diagnostic functions. Complete protection features include short-circuit protection (SCP), under-voltage protection (UVP), and thermal shutdown, alongside an onboard power supply existence-check circuit. This Click board™ is suitable as a multiple brushed DC motor driver for driving various loads in automotive and industrial applications, and more.

[Learn More]

Button G click

1

Button G click is the simplest solution for adding a single pushbutton to your design. The button itself is transparent, 6.8mm in diameter and has a green LED backlight. When pressed, it sends an interrupt signal to the target board microcontroller. The backlight LED is controlled separately through the mikroBUSâ„¢ PWM pin.

[Learn More]

SHT click

1

SHT click board caries new SHT3x-DIS by Sensirion. The board uses I2C bus to communicate with the target MCU and it can be powered with 3.3 V or 5 V power supply.

[Learn More]