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-03-07
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: Motion
Downloaded: 6141 times
Not followed.
License: MIT license
Earthquake click carries D7S, the world’s smallest high-precision seismic sensor from Omron. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target MCU over I2C interface, with additional functionality provided by the following pins on the mikroBUS line: PWM, INT, CS.
Do you want to subscribe in order to receive notifications regarding "Earthquake click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Earthquake click" changes.
Do you want to report abuse regarding "Earthquake click".
Library Description
The library initializes and defines the I2C bus driver and drivers that offer a choice for writing and reading
data in and from registers. The library includes functions for reading SI and PGA, check status, earthquake, collapse, work mode, processing notification, and shut off. The user can also run and read self-diagnostics, acquisition offset, clear Memory and reset the device. Library also has generic read/write functions for additional read and write operations.
Key functions:
uint16_t earthquake_readSI()
- Read SI function.Examples description
The application is composed of three sections :
void applicationTask() { if ( earthquake_procNotify() ) { mikrobus_logWrite( " Earthquake detected! ", _LOG_LINE ); mikrobus_logWrite( "------------------------", _LOG_LINE ); Delay_ms ( 2000 ); for ( cnt = 20; cnt > 0; cnt-- ) { mikrobus_logWrite( " Status : ", _LOG_TEXT ); displayStatus( earthquake_readStatus() ); mikrobus_logWrite( " Max SI : ", _LOG_TEXT ); readData = earthquake_readSI(); IntToStr( readData, txtLog ); ltrim( txtLog ); mikrobus_logWrite( txtLog, _LOG_LINE ); mikrobus_logWrite( "------------------------", _LOG_LINE ); Delay_ms( 5000 ); } earthquake_clearMememory(); mikrobus_logWrite( " Afterquake processing ", _LOG_LINE ); mikrobus_logWrite( " please wait... ", _LOG_LINE ); Delay_ms( 20000 ); mikrobus_logWrite( "------------------------", _LOG_LINE ); mikrobus_logWrite( " Waiting for a quake... ", _LOG_LINE ); mikrobus_logWrite( "------------------------", _LOG_LINE ); } }
Additional Functions :
Other mikroE Libraries used in the example:
I2C
UART
Conversions
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