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-08
Package Version: 1.0.0.1
mikroSDK Library: 1.0.0.0
Category: Pushbutton/Switches
Downloaded: 3969 times
Not followed.
License: MIT license
2x2 Key click has a 4 button keypad. The click allows multiple key presses and has a debounce circuit composed of 74HC32 quad 2-input OR gate from NXP and the SN74HC14 Hex Schmitt-Trigger Inverter from Texas Instruments. 2x2 Key click is designed to use either 3.3V or 5V power supply.
Do you want to subscribe in order to receive notifications regarding "2x2 Key click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "2x2 Key click" changes.
Do you want to report abuse regarding "2x2 Key click".
Library Description
The library covers all the necessary functions to control 2x2 Key click board. 2x2 Key click
communicates with the target board through the AN, RST, CS, 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 c2x2key_t2State();
- Function gets state of RST pin on 2X2_Key Click board.Examples description
The application is composed of three sections:
void applicationTask() { t1State = c2x2key_t1State(); if ( t1State == 1 && t1StateOld == 0 ) { mikrobus_logWrite( " Key 1 pressed ", _LOG_LINE ); mikrobus_logWrite( "- - - - - - - - -", _LOG_LINE ); t1StateOld = 1; } if ( t1State == 0 && t1StateOld == 1 ) { t1StateOld = 0; } t2State = c2x2key_t2State(); if ( t2State == 1 && t2StateOld == 0 ) { mikrobus_logWrite( " Key 2 pressed ", _LOG_LINE ); mikrobus_logWrite( "- - - - - - - - -", _LOG_LINE ); t2StateOld = 1; } if ( t2State == 0 && t2StateOld == 1 ) { t2StateOld = 0; } t3State = c2x2key_t3State(); if ( t3State == 1 && t3StateOld == 0 ) { mikrobus_logWrite( " Key 3 pressed ", _LOG_LINE ); mikrobus_logWrite( "- - - - - - - - -", _LOG_LINE ); t3StateOld = 1; if ( t3State == 0 && t3StateOld == 1 ) { t3StateOld = 0; } t4State = c2x2key_t4State(); if ( t4State == 1 && t4StateOld == 0 ) { mikrobus_logWrite( " Key 4 pressed ", _LOG_LINE ); mikrobus_logWrite( "- - - - - - - - -", _LOG_LINE ); t4StateOld = 1; } if ( t4State == 0 && t4StateOld == 1 ) { t4StateOld = 0; } }
Other mikroE Libraries used in the example:
UART
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