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-15
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: Capacitive
Downloaded: 4653 times
Followed by: 4 users
License: MIT license
Touchkey click has four capacitive pads powered by TTP224, a touchpad detector IC. Capacitive buttons like these can be toggled even when placed under a layer of glass or paper.
The example demonstrates the usage of TouchKey Click
Do you want to subscribe in order to receive notifications regarding "TouchKey click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "TouchKey click" changes.
Do you want to report abuse regarding "TouchKey click".
Library Description
The library covers all the necessary functions to control TouchKey click board. TouchKey click
communicates with the target board through the AN, RST, PWM and INT line. This library
offers functions for detecting the states of any and every of the four keys on this click board.
Key functions:
uint8_t touchkey_B();
- Function gets state of AN pin on TouchKey Click board.Examples description
The application is composed of three sections:
void applicationTask() { keyState = touchkey_A() | touchkey_B() | touchkey_C() | touchkey_D(); if( keyState == 1 && keyStateOld == 0 ) { mikrobus_logWrite( "Pressed : ", _LOG_TEXT ); if( touchkey_A() ) { mikrobus_logWrite( "A ", _LOG_TEXT ); } if( touchkey_B() ) { mikrobus_logWrite( "B ", _LOG_TEXT ); } if( touchkey_C() ) { mikrobus_logWrite( "C ", _LOG_TEXT ); } if( touchkey_D() ) { mikrobus_logWrite( "D ", _LOG_TEXT ); } mikrobus_logWrite( "", _LOG_LINE ); keyStateOld = 1; } if ( keyState == 0 && keyStateOld == 1 ) { keyStateOld = 0; } }
Other mikroE Libraries used in the example:
I2C
UART
Conversion
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