TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (392 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (123 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 (140532 times)
  2. FAT32 Library (73022 times)
  3. Network Ethernet Library (58023 times)
  4. USB Device Library (48211 times)
  5. Network WiFi Library (43821 times)
  6. FT800 Library (43292 times)
  7. GSM click (30351 times)
  8. mikroSDK (28983 times)
  9. PID Library (27112 times)
  10. microSD click (26709 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

Smart DOF 4 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-12-23

Package Version: 2.1.0.2

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 23 times

Not followed.

License: MIT license  

Smart DOF 4 Click is a compact add-on board for high-precision motion tracking and contextual sensing. This board features the BNO085, a 9-axis IMU System in Package (SiP) from CEVA, combining an accelerometer, gyroscope, and geomagnetic sensor with a 32-bit microcontroller running CEVA's SH-2 firmware. The board provides real-time, calibrated 3D orientation, linear acceleration, and angular velocity while dynamically compensating for temperature changes and sensor aging. It supports I2C and SPI interfaces, features advanced MotionEngine™ technology for gesture detection and activity monitoring, and includes 'Always-On' capabilities like step counting and stability detection.

No Abuse Reported
  • Information
  • Comments (0)

mikroSDK Library Blog


Smart DOF 4 Click

Smart DOF 4 Click is a compact add-on board for high-precision motion tracking and contextual sensing. This board features the BNO085, a 9-axis IMU System in Package (SiP) from CEVA, combining an accelerometer, gyroscope, and geomagnetic sensor with a 32-bit microcontroller running CEVA's SH-2 firmware. The board provides real-time, calibrated 3D orientation, linear acceleration, and angular velocity while dynamically compensating for temperature changes and sensor aging. It supports I2C and SPI interfaces, features advanced MotionEngine™ technology for gesture detection and activity monitoring, and includes 'Always-On' capabilities like step counting and stability detection.

smartdof4_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Aug 2024.
  • Type : I2C/SPI type

Software Support

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

Standard key functions :

  • smartdof4_cfg_setup Config Object Initialization function.

    void smartdof4_cfg_setup ( smartdof4_cfg_t *cfg );
  • smartdof4_init Initialization function.

    err_t smartdof4_init ( smartdof4_t *ctx, smartdof4_cfg_t *cfg );
  • smartdof4_default_cfg Click Default Configuration function.

    err_t smartdof4_default_cfg ( smartdof4_t *ctx );

Example key functions :

  • smartdof4_read_pid This function reads the product ID information.

    err_t smartdof4_read_pid ( smartdof4_t *ctx, smartdof4_pid_t *pid );
  • smartdof4_feature_set This function sets a full feature report.

    err_t smartdof4_feature_set ( smartdof4_t *ctx, smartdof4_feature_t *feat );
  • smartdof4_read_data This function reads the accelerometer (g), gyroscope (dps), and magnetometer (uT) 3-axis data from input report.

    err_t smartdof4_read_data ( smartdof4_t *ctx, smartdof4_axis_t *accel, 
                              smartdof4_axis_t *gyro, smartdof4_axis_t *mag );

Example Description

This example demonstrates the use of Smart DOF 4 Click board by reading the accelerometer, gyroscope, and magnetometer data measurements.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the Click default configuration enabling accelerometer, gyroscope, and magnetometer sensors with an output data rate of 10Hz. After that, it reads the software version, part number, and build number information.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    smartdof4_cfg_t smartdof4_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.
    smartdof4_cfg_setup( &smartdof4_cfg );
    SMARTDOF4_MAP_MIKROBUS( smartdof4_cfg, MIKROBUS_1 );
    err_t init_flag = smartdof4_init( &smartdof4, &smartdof4_cfg );
    if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( SMARTDOF4_ERROR == smartdof4_default_cfg ( &smartdof4 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    smartdof4_pid_t pid;
    if ( SMARTDOF4_OK == smartdof4_read_pid ( &smartdof4, &pid ) )
    {
        log_printf ( &logger, " SW Version: %u.%u.%u\r\n", ( uint16_t ) pid.sw_ver_major, 
                                                           ( uint16_t ) pid.sw_ver_minor, 
                                                           ( uint16_t ) pid.sw_ver_patch );
        log_printf ( &logger, " SW Part Number: %lu\r\n", pid.sw_part_num );
        log_printf ( &logger, " SW Build Number: %lu\r\n\n", pid.sw_build_num );
    }

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

Application Task

Reads the accelerometer (g), gyroscope (dps), and magnetometer (uT) measurements and displays results on the USB UART every 100ms approximately.

void application_task ( void )
{
    static smartdof4_axis_t accel, gyro, mag;
    if ( SMARTDOF4_OK == smartdof4_read_data ( &smartdof4, &accel, &gyro, &mag ) )
    {
        log_printf ( &logger, " Accel X: %.3f g\r\n", accel.x );
        log_printf ( &logger, " Accel Y: %.3f g\r\n", accel.y );
        log_printf ( &logger, " Accel Z: %.3f g\r\n", accel.z );
        log_printf ( &logger, " Gyro X: %.1f dps\r\n", gyro.x );
        log_printf ( &logger, " Gyro Y: %.1f dps\r\n", gyro.y );
        log_printf ( &logger, " Gyro Z: %.1f dps\r\n", gyro.z );
        log_printf ( &logger, " Mag X: %.1f uT\r\n", mag.x );
        log_printf ( &logger, " Mag Y: %.1f uT\r\n", mag.y );
        log_printf ( &logger, " Mag Z: %.1f uT\r\n\n", mag.z );
        Delay_ms ( 100 );
    }
}

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

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

4G LTE 3 E Click

0

4G LTE 3 Click (for Europe) is a compact add-on board for reliable LTE connectivity, offering medium data speeds and extensive network coverage. This board features the LEXI-R10801D, a single-mode LTE Cat 1bis module from u-blox optimized for professional-grade applications in the EMEA, APAC, and Brazilian regions. The module supports various LTE FDD bands (1, 3, 5, 7, 8, 20, and 28), features download speeds of up to 10Mbps and upload speeds of 5Mbps, and integrates an embedded Wi-Fi scan for indoor positioning with u-blox CellLocate® geolocation capabilities. It includes a UART interface for communication, USB Type C for power and firmware updates, and versatile control options like GPIO pins and visual indicators for network and power status.

[Learn More]

TempHum 21 Click

0

Temp&Hum 21 Click is a compact add-on board representing temperature and humidity sensing solution. This board features the HIH8130-021-001, a highly accurate, fully-calibrated digital humidity and temperature sensor from Honeywell Sensing and Productivity Solutions. This sensor, characterized by its high accuracy (±2% RH and ±0.5°C over a wide operating temperature range) and high resolution, provides factory-calibrated 14-bit data to the host controller with a configurable I2C interface. It also comes with alarm features with selectable alarm thresholds by an MCU or externally.

[Learn More]

Force 4 click

5

Force 4 Click is based on HSFPAR003A piezoresistive force sensor from Alpsalpine. This product is a force sensor using the effect of a piezoresistive bridge circuit formed on silicon diaphragm. Piezoresistive force sensors achieve higher linearity than other force sensors.

[Learn More]
Close menu