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-07-30
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: Motion
Downloaded: 3557 times
Followed by: 3 users
License: MIT license
Shake2Wake click carries an ADXL362 accelerometer, a ADP195 power switch, and a screw terminal for activating external devices using the accelerometer’s built-in activity detection modes.
Do you want to subscribe in order to receive notifications regarding "Shake2Wake Click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Shake2Wake Click" changes.
Do you want to report abuse regarding "Shake2Wake Click".
Library Description
The library covers all the necessary functions for the usage of the Shake2Wake Click board. The library initializes and defines the SPI driver and drivers that offer a choice for writing and reading data in and from registers. User can read accelerometer data in 8 or 12 bits or have them calulated in "G"s. Temperature can be also read from an internal sensor. Furthermore, user has a choice of many different types of possible settings. For additional functionality, read/write one or multiple bytes, as well as FIFO burst read is available to the user.
Key functions:
void shake2wake_getLoResRawData( uint8_t *xVal, uint8_t *yVal, uint8_t *zVal )
- Function is used to read 8-bit accelerometer data per axis.void shake2wake_getRawData( int16_t *xVal, int16_t *yVal, int16_t *zVal )
- Function is used to read the 3-axis raw data from the accelerometer.float shake2wake_readTemperature()
- Function is used to read temperature from an internal sensor.Examples description
The application is composed of three sections :
void applicationTask() { shake2wake_getRawData( &xVal, &yVal, &zVal ); temperature = shake2wake_readTemperature(); IntToStr( xVal, logTxt ); mikrobus_logWrite( "X axis: ", _LOG_TEXT ); mikrobus_logWrite( logTxt, _LOG_LINE ); IntToStr( yVal, logTxt ); mikrobus_logWrite( "Y axis: ", _LOG_TEXT ); mikrobus_logWrite( logTxt, _LOG_LINE ); IntToStr( zVal, logTxt ); mikrobus_logWrite( "Z axis: ", _LOG_TEXT ); mikrobus_logWrite( logTxt, _LOG_LINE ); FloatToStr( temperature, logTxt ); mikrobus_logWrite( "Temperature: ", _LOG_TEXT ); mikrobus_logWrite( logTxt, _LOG_TEXT ); mikrobus_logWrite( degCel, _LOG_LINE ); mikrobus_logWrite( "--------------------------", _LOG_LINE ); Delay_ms( 1000 ); }
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.
Note*
This library represents an easy to use plug in for the supported platforms below. Installation of the library, examples, and help files are provided by the Package Manager - http://www.mikroe.com/package-manager/