TOP Contributors

  1. MIKROE (2649 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 (136522 times)
  2. FAT32 Library (69719 times)
  3. Network Ethernet Library (55833 times)
  4. USB Device Library (46164 times)
  5. Network WiFi Library (41797 times)
  6. FT800 Library (40980 times)
  7. GSM click (28920 times)
  8. PID Library (26383 times)
  9. mikroSDK (26273 times)
  10. microSD click (25296 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: 5506 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

Color 2 click

1

Color 2 click carries the ISL29125 RGB color light sensor. It detects red, green and blue in a variety of lighting conditions, outputting 16-bit resolution data in a 5.7m lux-10,000 lux measuring range. The board communicates with the target MCU through the mikroBUSâ„¢ I2C interface (SCL and SDA pins).

[Learn More]

Tamper 2 click

5

Tamper 2 click contains a levered D2HW-A221Dswitch by Omron, which outputs signal in both positions - pressed and released. The most common use of the Tamper 2 click is door opening or closing detection, detecting the end of travel of a linear actuator, a Morse code input device, etc.

[Learn More]

Charger 6 click

0

Charger 6 Click is a compact add-on board that represents a single-cell battery charger. This board features the BQ25601, an I2C controlled battery charger for high input voltage and narrow voltage DC power path management from Texas Instruments. This buck charger supports USB, and it’s optimized for USB voltage input. The low impedance power path optimizes switch-mode operation efficiency, reduces battery charging time, and extends battery life during discharge. It also has a programmable current limiting, allowing it to use an external power supply rated up to 13.5V. This Click board™ is suitable as a Li-Ion and Li-polymer battery charger for portable devices and accessories, power tools, and more.

[Learn More]