TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 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 (136553 times)
  2. FAT32 Library (69756 times)
  3. Network Ethernet Library (55854 times)
  4. USB Device Library (46194 times)
  5. Network WiFi Library (41814 times)
  6. FT800 Library (41009 times)
  7. GSM click (28931 times)
  8. PID Library (26386 times)
  9. mikroSDK (26296 times)
  10. microSD click (25304 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: 5521 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

Load cell click

0

Load cell click is a weight measurement click which utilizes a load cell element, in order to precisely measure the weight of an object. The Load Cell click can be used with the strain gauge type of load cells and can measure up to ±20V or ±40V of differential voltage.

[Learn More]

DIGI POT 2 click

0

DIGI POT 2 click is a mikroBUS™ add-on board with a single channel digital potentiometer TPL0501 with 256 wiper positions.

[Learn More]

Buck Boost 2 click

0

Buck-Boost 2 click is an advanced DC-DC step-down/step-up regulator (buck/boost), which is able to provide regulated 5V on its output, regardless of the input voltage.

[Learn More]