TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 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 (136721 times)
  2. FAT32 Library (69928 times)
  3. Network Ethernet Library (55939 times)
  4. USB Device Library (46264 times)
  5. Network WiFi Library (41884 times)
  6. FT800 Library (41168 times)
  7. GSM click (28979 times)
  8. PID Library (26412 times)
  9. mikroSDK (26357 times)
  10. microSD click (25355 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 13 click

Rating:

5

Author: MIKROE

Last Updated: 2019-09-09

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Motion

Downloaded: 2356 times

Not followed.

License: MIT license  

Accel 13 Click features an ultra-low power triaxial accelerometer sensor with embedded intelligence, labeled as the IIS2DLPC.

No Abuse Reported

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

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

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

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Accel 13 click

Accel 13 click

Native view of the Accel 13 click board.

View full image
Accel 13 click

Accel 13 click

Front and back view of the Accel 13 click board.

View full image

Library Description

The library initializes and defines the I2C or SPI bus driver and drivers that offer a choice for writing data in registers and read data from registers. The library includes function for read X/Y/Z axis data and function for Tap detection interrupt. The user also has the function for start configuration chip for measurement and function for read interrupt state.

Key functions:

  • void accel13_startCtrlConfig() - Start configuration module
  • void accel13_getAxisData(T_ACCEL13_AXIS *axis) - Axis data
  • void accel13_getTapStatus(T_ACCEL13_TAP *tapStatus) - Get Tap status

Examples description

The application is composed of three sections :

  • System Initialization - Initializes I2C or SPI module and sets necessary GPIO pins
  • Application Initialization - Initializes driver init, Test communication, start configuration chip for measurement and reads Temperature
  • Application Task - Reads Accelerometer data and detects tap on the axis

Note: The example is the basic functionality of the IIS2DLPC sensor, it is possible to read the acceleration data and detect Tap on all 3 axes. For other settings and improvements in reading accuracy, you need to further set up the registers and set the sensor to your conditions.

void applicationTask()
{
    /* Reads Accel data */
    accel13_getAxisData(&axis);

    mikrobus_logWrite("---- Accel axis data ----", _LOG_LINE);
    IntToStr(axis.x, demoText);
    mikrobus_logWrite("* X : ", _LOG_TEXT);
    mikrobus_logWrite(demoText, _LOG_LINE);
    
    IntToStr(axis.y, demoText);
    mikrobus_logWrite("* Y : ", _LOG_TEXT);
    mikrobus_logWrite(demoText, _LOG_LINE);
    
    IntToStr(axis.z, demoText);
    mikrobus_logWrite("* Z : ", _LOG_TEXT);
    mikrobus_logWrite(demoText, _LOG_LINE);
    mikrobus_logWrite("-------------------------", _LOG_LINE);
    Delay_ms( 300 );
    
    /* Detections Tap on the axis */
    accel13_getTapStatus(&tap);
    if(tap.tap_x == 0x01)
    {
        mikrobus_logWrite("---- Tap on the X axis ----", _LOG_LINE);
    }
    if(tap.tap_y == 0x01)
    {
        mikrobus_logWrite("---- Tap on the Y axis ----", _LOG_LINE);
    }
    if(tap.tap_z == 0x01)
    {
        mikrobus_logWrite("---- Tap on the Z axis ----", _LOG_LINE);
    }
}

Other mikroE Libraries used in the example:

  • I2C library
  • SPI library
  • UART library
  • Conversions library

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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

16x9 G click

5

16x9 G click contains a green LED matrix and the IS31FL3731 audio modulated matrix LED driver. The dimension of the LED matrix is 16x9. Each LED can be controlled individually – both for on/off control and light intensity.

[Learn More]

AudioAmp 6 click

0

Audio Amp 6 click is a mono/subwoofer audio amplifier, capable of delivering up to 18.5W per channel with the 4Ω load. It is based on the TPA3138D2, a class-D integrated amplifier, which utilizes a highly efficient switching scheme.

[Learn More]

SRAM click

6

SRAM click lets you add 1 Mbit of additional SRAM memory to your devices, via the 23LC1024 chip. The board communicates with the target MCU through the mikroBUS SPI interface (MISO, MOSI, SCK, CS). SRAM click is designed to use either a 3.3V or 5V power supply.

[Learn More]