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]
Rating:
Author: MIKROE
Last Updated: 2019-09-09
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Motion
Downloaded: 2765 times
Not followed.
License: MIT license
Accel 13 Click features an ultra-low power triaxial accelerometer sensor with embedded intelligence, labeled as the IIS2DLPC.
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".
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 modulevoid accel13_getAxisData(T_ACCEL13_AXIS *axis)
- Axis datavoid accel13_getTapStatus(T_ACCEL13_TAP *tapStatus)
- Get Tap statusExamples description
The application is composed of three sections :
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:
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.