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: 5086 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
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
TFT Proto 5" carries a 800x480 HT050AWV40T TFT screen covered with a 4-wire resistive touchscreen panel. To drive the 262k-color display, there's an SSD1963 graphic controller with a 8/9/16/24-bit MCU interface. The touchpanel is driven by an advanced STMPE811 controller. TFT Proto 5" uses a 3.3V power supply only.
[Learn More]TDC Click is a compact add-on board that recognizes events and provides a digital representation of the time they occurred. This board features the TDC7200, a time-to-digital converter from Texas Instruments. The Time to Digital Converter (TDC) performs the function of a stopwatch and measures the elapsed time (time-of-flight or TOF) between a START pulse and up to five STOP pulses. The ability to measure from START to multiple STOPs gives users the flexibility to select which STOP pulse yields the best echo performance.
[Learn More]EEPROM Click is an accessory board in mikroBUS form factor. It features 24C08WP - a highly reliable, high performance CMOS technology serial 8K EEPROM in DIP packaging.
[Learn More]You have unsaved changes. If you choose to leave all changes will be discarded.
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".