TOP Contributors

  1. MIKROE (2653 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 (136668 times)
  2. FAT32 Library (69909 times)
  3. Network Ethernet Library (55923 times)
  4. USB Device Library (46251 times)
  5. Network WiFi Library (41882 times)
  6. FT800 Library (41129 times)
  7. GSM click (28973 times)
  8. PID Library (26406 times)
  9. mikroSDK (26345 times)
  10. microSD click (25350 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

Tilt click

Rating:

5

Author: MIKROE

Last Updated: 2019-03-12

Package Version: 1.0.0.1

mikroSDK Library: 1.0.0.0

Category: Motion

Downloaded: 5529 times

Followed by: 4 users

License: MIT license  

Tilt click carries RPI-1035, a 4-directional optical tilt sensor. This type of sensor provides positional feedback for left, right, up or down movements. Tilt click communicates with the target board microcontroller through mikroBUS PWM and INT lines, used here for vout1 and vout2 outputs from the sensor.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Tilt click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Tilt click" changes.

Do you want to report abuse regarding "Tilt click".

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

Tilt click board

Tilt click board

Front and back side appearance of the Tilt click board.

View full image

Library Description

The library covers all the necessary functions to control Tilt Click board. Tilt click communicates with the target board via GPIO protocol, PWM and INT pins. This library contains drivers to detect tilt movement's direction: left, right, up or down.

Key functions:

  • uint8_t tilt_direction() - Check the tilt movement's direction function.
  • uint8_t tilt_left() - Check the tilt left movement's direction function.
  • uint8_t tilt_up() - Check the tilt up movement's direction function.

Examples description

The application is composed of three sections:

  • System Initialization - Initializes GPIO, sets PWM and INT pins as input.
  • Application Initialization -  Initialization driver enables - GPIO and start to write log.
  • Application Task - (code snippet) This is an example which demonstrates the use of Tilt Click board. Detect the movement's direction of RPI-1035 Surface Mount Type 4-Direction Detector on Tilt click board. Results are being sent to the Usart Terminal where you can track their changes. All data logs on usb uart when the movement's direction is changed.
void applicationTask() 
{
    tiltDirection = tilt_direction();
  
    if ( tiltDirectionOld != tiltDirection )
    {
        if ( tiltDirection == _TILT_LEFT_DETECTION )
            mikrobus_logWrite( "    LEFT     ", _LOG_LINE );

        if ( tiltDirection == _TILT_RIGHT_DETECTION )
            mikrobus_logWrite( "    RIGHT    ", _LOG_LINE );

        if ( tiltDirection == _TILT_UP_DETECTION )
            mikrobus_logWrite( "     UP      ", _LOG_LINE );

        if ( tiltDirection == _TILT_DOWN_DETECTION )
            mikrobus_logWrite( "    DOWN     ", _LOG_LINE );

        tiltDirectionOld = tiltDirection;
        mikrobus_logWrite( "-------------", _LOG_LINE );
    }  
}      

Other mikroE Libraries used in the example:

  • GPIO
  • UART

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

ALSO FROM THIS AUTHOR

iButton click

0

iButton click - is an iButton™ probe Click board™. The iButton is a Analog Devices technology based on Analog's 1-Wire® communication protocol, and a chip usually packed in a robust stainless steel casing. The button-shaped iButton device has two contacts - the lid and the base. These contacts carry the necessary connections down to a sensitive silicone chip, embedded inside the metal button. When the iButton touches the reader probe on the Click board™, it establishes the communication with the host MCU, via the 1-Wire® interface. The communication is almost instant, so it is enough to press the iButton lightly to the probe contacts.

[Learn More]

RN4871 click

6

RN4871 click carries the RN4871 Bluetooth® 4.2 low energy module from Microchip. The click is designed to run on a 3.3V power supply. It communicates with the target microcontroller over UART interface, with additional functionality provided by the following pins on the mikroBUS™ line: RST, CS and INT.

[Learn More]

H-Bridge 5 click

0

The H-Bridge 5 Click is designed for control DC motors and inductiv loads. This Click board™ contains the MP6515GF-Z, a H-bridge motor driver from MPS, It features an Full H-Bridge driver with Internal safety features include over-current protection, input over-voltage protection, under voltage lockout (UVLO), and thermal shutdown.

[Learn More]