TOP Contributors

  1. MIKROE (2652 codes)
  2. Alcides Ramos (351 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 (136632 times)
  2. FAT32 Library (69836 times)
  3. Network Ethernet Library (55891 times)
  4. USB Device Library (46226 times)
  5. Network WiFi Library (41863 times)
  6. FT800 Library (41084 times)
  7. GSM click (28944 times)
  8. PID Library (26402 times)
  9. mikroSDK (26317 times)
  10. microSD click (25328 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

Shake2Wake Click

Rating:

1

Author: MIKROE

Last Updated: 2019-07-30

Package Version: 1.0.0.1

mikroSDK Library: 1.0.0.0

Category: Motion

Downloaded: 3084 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.

No Abuse Reported

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".

  • mikroSDK Library 2.0.0.0
  • Comments (2)
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

Shake2Wake

Shake2Wake

Front and back view of the click board

View full image

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 :

  • System Initialization - Initializes SPI module, LOG and GPIO structures, sets CS pin as output and INT pin as input.
  • Application Initialization - Initalizes SPI driver, applies default settings and makes an initial log.
  • Application Task - This is an example that shows the capabilities of the Shake2Wake click by reading values of an accelerometer and logging them on USART terminal and, in case of an interrupt, it raises voltage on the connector.
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:

  • SPI
  • UART
  • Conversions

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.

Shake2Wake Schematic

Shake2Wake Schematic

Schematic

View full image

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/

ALSO FROM THIS AUTHOR

Accel 15 click

0

Accel 15 Click is a compact add-on board that contains a longevity acceleration sensor. This board features the BMA490L, a high-performance 16-bit digital triaxial acceleration sensor with extended availability of up to ten years from Bosch Sensortech. It allows selectable full-scale acceleration measurements in ranges of ±2g, ±4g, ±8g, and ±16g in three axes with a configurable host interface that supports both I2C and SPI serial communication and with intelligent on-chip motion-triggered interrupt features. Intelligent signal processing and evaluation in the accelerometer ASIC enables advanced gesture recognition for numerous industrial IoT applications where low power consumption is vital. This Click board™ is suitable for home appliances, power tools, and other industrial products whose lifetime is essential.

[Learn More]

8x8 B click

5

8x8 clicks are 8x8 LED matrix displays in form of add-on boards in mikroBUS form factor. Boards feature MAX7219 8-digit LED display driver module as well as 64 LED diodes.

[Learn More]

DAC 6 click

5

DAC 6 Click is a compact add-on board that contains a fully-featured, general-purpose voltage-output digital-to-analog converter. This board features the DAC104S085, 10-bit resolution micro-power QUAD digital-to-analog converter with rail-to-rail output, from Texas Instruments.

[Learn More]