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-01-18
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Motion
Downloaded: 3959 times
Not followed.
License: MIT license
Tilt 2 click is a tilt sensor switch, which breaks the circuit when tilted to an angle of 45° or when shaken. It is a single-pole-double-throw type of switch (SPDT), which can be operated with up to 24V. The current through the switch should not exceed 25mA.
Do you want to subscribe in order to receive notifications regarding "Tilt 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Tilt 2 click" changes.
Do you want to report abuse regarding "Tilt 2 click".
Library Description
The library contains a tilt detection function.
Key functions:
uint8_t tilt2_tiltDetection()
- Tilt detection.Examples description
The application is composed of the three sections :
void applicationTask()
{
uint8_t tilt;
tilt = tilt2_tiltDetection();
if(tilt == _TILT2_TILT_DETECTION)
{
mikrobus_logWrite(" Tilt detection.. ", _LOG_LINE);
Delay_ms( 300 );
}
}
Other mikroE Libraries used in the example:
GPIO
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 clickor 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.