TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 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 (136533 times)
  2. FAT32 Library (69726 times)
  3. Network Ethernet Library (55837 times)
  4. USB Device Library (46169 times)
  5. Network WiFi Library (41798 times)
  6. FT800 Library (40984 times)
  7. GSM click (28921 times)
  8. PID Library (26383 times)
  9. mikroSDK (26276 times)
  10. microSD click (25297 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 24 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.7

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 64 times

Not followed.

License: MIT license  

Accel 24 Click is a compact add-on board that contains an acceleration sensor. This board features the MXC6655XA, a 12-bit three-axis accelerometer from MEMSIC. It allows selectable full-scale acceleration measurements in ranges of ±2g, ±4g, or ±8g in three axes with a compatible I2C serial interface with 400KHz fast mode operation. Alongside low offset and temperature signal with high accuracy, the MXC6655XA also detects six orientation positions, X/Y shake, and shake directions with an appropriate interrupt signal for these states.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Accel 24 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Accel 24 click" changes.

Do you want to report abuse regarding "Accel 24 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Accel 24 click

Accel 24 Click is a compact add-on board that contains an acceleration sensor. This board features the MXC6655XA, a 12-bit three-axis accelerometer from MEMSIC. It allows selectable full-scale acceleration measurements in ranges of ±2g, ±4g, or ±8g in three axes with a compatible I2C serial interface with 400KHz fast mode operation. Alongside low offset and temperature signal with high accuracy, the MXC6655XA also detects six orientation positions, X/Y shake, and shake directions with an appropriate interrupt signal for these states.

accel24_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Aug 2022.
  • Type : I2C type

Software Support

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

Standard key functions :

  • accel24_cfg_setup Config Object Initialization function.

    void accel24_cfg_setup ( accel24_cfg_t *cfg );
  • accel24_init Initialization function.

    err_t accel24_init ( accel24_t *ctx, accel24_cfg_t *cfg );
  • accel24_default_cfg Click Default Configuration function.

    err_t accel24_default_cfg ( accel24_t *ctx );

Example key functions :

  • accel24_get_int_pin This function returns the INT pin logic state.

    uint8_t accel24_get_int_pin ( accel24_t *ctx );
  • accel24_read_data This function checks the data ready bit, clears it, and then reads the accel (X, Y, Z) and temperature measurements.

    err_t accel24_read_data ( accel24_t *ctx, accel24_data_t *data_out );
  • accel24_set_full_scale_range This function sets the full scale range resolution.

    err_t accel24_set_full_scale_range ( accel24_t *ctx, uint8_t fsr );

Example Description

This example demonstrates the use of Accel 24 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. */
    accel24_cfg_t accel24_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.
    accel24_cfg_setup( &accel24_cfg );
    ACCEL24_MAP_MIKROBUS( accel24_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == accel24_init( &accel24, &accel24_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( ACCEL24_ERROR == accel24_default_cfg ( &accel24 ) )
    {
        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 )
{
    accel24_data_t meas_data;
    // Wait for data ready indication
    while ( accel24_get_int_pin ( &accel24 ) );

    if ( ACCEL24_OK == accel24_read_data ( &accel24, &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.Accel24

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

MCP2518FD click

0

MCP2518FD Click is a compact add-on board representing a complete CAN solution used as a control node in a CAN network. This board features the MCP2518FD, an external CAN FD controller with an SPI interface, and a high-speed CAN transceiver, the ATA6563, both from Microchip. The ATA6563, a low-level physical layer IC (PHY), provides a physical connection with the CAN bus itself, while the CAN controller MCP2518FD represents an interface between the MCU and the PHY. It features three operating modes with dedicated fail-safe features, remote wake-up via CAN, and ideally passive behavior when powered off on the CAN bus. This Click board™ is suitable for developing a wide range of automotive diagnostic applications, even on MCUs that do not natively support CAN interface.

[Learn More]

Air quality click

0

Air quality click carries an MQ-135 sensor for detecting poisonous gases that impact air quality in homes and offices. The click is designed to run on a 5V power supply. It communicates with the target microcontroller over the AN pin on the mikroBUS™ line.

[Learn More]

IoT ExpressLink 3 click

0

IoT ExpressLink 3 Click is a compact add-on board that allows users to connect easily to IoT ExpressLink services and securely interact with cloud applications and other devices. This board features the NORA-W256WS, a standalone multi-radio module from u-blox. The module supports Wi-Fi radio at 802.11b/g/n standard and 2.4GHz of ISM band. It also supports the Bluetooth Low Energy 5. The embedded AWS IoT ExpressLink-compliant software includes secured pre-flashed certificates in the module.

[Learn More]