TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 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 (136713 times)
  2. FAT32 Library (69924 times)
  3. Network Ethernet Library (55936 times)
  4. USB Device Library (46259 times)
  5. Network WiFi Library (41884 times)
  6. FT800 Library (41150 times)
  7. GSM click (28979 times)
  8. PID Library (26410 times)
  9. mikroSDK (26355 times)
  10. microSD click (25353 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

TouchKey 3 click

Rating:

5

Author: MIKROE

Last Updated: 2018-03-13

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Capacitive

Downloaded: 4719 times

Not followed.

License: MIT license  

TouchKey 3 click is equipped with advanced capacitive sensors, based on the proprietary QTouch technology, that can be used to sense touch on 7 different keys.

No Abuse Reported

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

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

Do you want to report abuse regarding "TouchKey 3 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

TouchKey 3 click

TouchKey 3 click

Native view of the TouchKey 3 Click board.

View full image
TouchKey 3 click

TouchKey 3 click

Fron and back view of the TouchKey 3 Click board.

View full image

Library Description

The library contains functions that communicate with TouchKey 3 click via SPI interface. It covers all the modes of communication with the click that are available.

Key functions

uint8_t touchkey3_sendCommand(uint8_t command) - Sends a command to TouchKey 3 click

uint8_t touchkey3_sendRequest(uint8_t request, uint8_t * pResponse) - Retrieves a response to a request from TouchKey 3 click

uint8_t touchkey3_setData(uint8_t dataAddress, uint8_t writeData) - Writes data into configuration registers

Examples Description

The demo application is composed of three sections:

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes click driver and performs a soft reset of the click.
  • Application Task - (Code snippet) - Reads the status of the keys and outputs a message if a key is touched.
void applicationTask()
{
    uint8_t returnData[ 2 ];
    uint8_t counter;
    uint8_t temp;
    uint8_t text[ 20 ] = { 0 };

    touchkey3_sendRequest( _TOUCHKEY3_REQ_ALL_KEYS, &returnData );

    for (counter = 0; counter < 7; counter++)
    {
        if ((returnData[1] >> counter) & 0x01)
        {
            mikrobus_logWrite( "Touch detected on key ", _LOG_TEXT );
            //Converts the key index into ascii character ( 0 - 7 -> '1' - '7')
            temp = counter + 49;
            WordToStr( temp, text );
            mikrobus_logWrite( text, _LOG_TEXT );
            mikrobus_logWrite( ".", _LOG_LINE );
            Delay_ms( 1000 );
        }
    }
    Delay_ms( 200 );
}

Other MikroElektronika libraries used in the example:

  • UART

Additional notes and information

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

Clock Gen 3 click

5

Clock Gen 3 Click features a low power self-contained digital frequency source providing a precision frequency from 1kHz to 68MHz, set through a serial port.

[Learn More]

PAC1944 click

0

PAC1944 Click is a compact add-on board that contains an energy monitoring solution. This board features the PAC1944, a multi-channel DC power/energy monitor from Microchip Technology. It uses real-time calibration to minimize offset and gain errors with no input filters required for this device.

[Learn More]

TempHum 22 click

0

Temp&Hum 22 Click is a compact add-on board representing temperature and humidity sensing solution. This board features the SHT41A, a 4th generation automotive-grade relative humidity and temperature sensor from Sensirion. The SHT41A is characterized by its high accuracy (±2% RH and ±0.3°C over a wide operating temperature range) and high resolution providing 16-bit data to the host controller with a configurable I2C interface. Also, it is designed for reliable operation in harsh conditions such as condensing environments.

[Learn More]