TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139253 times)
  2. FAT32 Library (71751 times)
  3. Network Ethernet Library (57122 times)
  4. USB Device Library (47430 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28078 times)
  9. PID Library (26885 times)
  10. microSD click (26198 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

Accel 25 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.7

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 66 times

Not followed.

License: MIT license  

Accel 25 Click is a compact add-on board that contains an acceleration sensor. This board features the MXC4005XC, a 12-bit three-axis thermal accelerometer from MEMSIC. It allows selectable full-scale acceleration measurements of ±2g, ±4g, or ±8g in three axes with a compatible I2C serial interface with 400KHz fast mode operation.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Accel 25 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Accel 25 Click" changes.

Do you want to report abuse regarding "Accel 25 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Accel 25 Click

Accel 25 Click is a compact add-on board that contains an acceleration sensor. This board features the MXC4005XC, a 12-bit three-axis thermal accelerometer from MEMSIC. It allows selectable full-scale acceleration measurements of ±2g, ±4g, or ±8g in three axes with a compatible I2C serial interface with 400KHz fast mode operation.

accel25_click.png

Click Product page


Click library

  • Author : Stefan Ilic
  • Date : Feb 2023.
  • Type : I2C type

Software Support

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

Standard key functions :

  • accel25_cfg_setup Config Object Initialization function.

    void accel25_cfg_setup ( accel25_cfg_t *cfg );
  • accel25_init Initialization function.

    err_t accel25_init ( accel25_t *ctx, accel25_cfg_t *cfg );
  • accel25_default_cfg Click Default Configuration function.

    err_t accel25_default_cfg ( accel25_t *ctx );

Example key functions :

  • accel25_soft_reset Accel 25 soft reset function.

    err_t accel25_soft_reset ( accel25_t *ctx );
  • accel25_set_full_scale_range Accel 25 set full scale range function.

    err_t accel25_set_full_scale_range ( accel25_t *ctx, uint8_t fsr );
  • accel25_read_data Accel 25 read data function.

    err_t accel25_read_data ( accel25_t *ctx, accel25_data_t *data_out );

Example Description

This example demonstrates the use of Accel 25 Click board by reading and displaying accel data (X, Y, and Z axis) as well as temperature measurements on the USB UART.

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. */
    accel25_cfg_t accel25_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.
    accel25_cfg_setup( &accel25_cfg );
    ACCEL25_MAP_MIKROBUS( accel25_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == accel25_init( &accel25, &accel25_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( ACCEL25_ERROR == accel25_default_cfg ( &accel25 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

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

Application Task

Reads and displays the accel data (X, Y, and Z axis) as well as temperature measurements on the USB UART every 100ms approximately.

void application_task ( void ) 
{
    accel25_data_t meas_data;
    // Wait for data ready indication
    if ( ACCEL25_PIN_STATE_LOW == accel25_get_int_pin ( &accel25 ) );
    {
        if ( ACCEL25_OK == accel25_read_data ( &accel25, &meas_data ) )
        {
            log_printf( &logger, " X: %.3f g\r\n", meas_data.x );
            log_printf( &logger, " Y: %.3f g\r\n", meas_data.y );
            log_printf( &logger, " Z: %.3f g\r\n", meas_data.z );
            log_printf( &logger, " Temperature: %.2f degC\r\n", meas_data.temperature );
        }
    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.Accel25

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

Mikromedia 4 for STM32F4 Capacitive

0

This project contains example for testing modules on Mikromedia 4 for STM32F4 Capacitive.

[Learn More]

DALI 2 click

5

DALI 2 click offers a simple and reliable interface to DALI and DALI 2 communication bus, making it possible to dive into the world of intelligent lighting.

[Learn More]

EXPAND 7 click

5

EXPAND 7 Click is a compact add-on board that contains a multi-port I/O expander with bi-directional input/outputs or PWM outputs. This board features the CY8C9540A, 40-bit I/O port expander with EEPROM and 8 independently configurable 8-bit PWM outputs from Cypress Semiconductor.

[Learn More]