4x4 Keypad easy to use library that pollis the interface width pullups

Dependents:   4x4KeyBoardExample xoxokey 4x4KeyBoardExample ProgettoCassaforte ... more

Fork of keypad by Dimiter K

Simple library for reading a 4x4 keypad width at ability to use internal pullups

Import program

00001 #include "mbed.h"
00002 #include "keypad.h"
00003  
00004 Serial pc(USBTX, USBRX); 
00005 
00006  
00007 int main() {
00008                 //  c0   c1   c2   c3  r0   r1   r2   r3    
00009     Keypad keypad( PC_3,PC_2,PA_0,PA_1,PA_4,PB_0,PC_1,PC_0 );
00010        
00011     keypad.enablePullUp();
00012     char key;
00013     pc.printf("Please touch a key on the keypad\n\r");
00014     while (1) 
00015     {
00016          key = keypad.getKey();    
00017          if(key != KEY_RELEASED)
00018          {
00019              pc.printf("%c\r\n",key);
00020              wait(0.6);
00021          }
00022     }
00023 }

Import library

Public Member Functions

Keypad (PinName col0, PinName col1, PinName col2, PinName col3, PinName row0, PinName row1, PinName row2, PinName row3)
Create a 4x4 (col, row) or 4x4 keypad interface
.
char getKey ()
Returns the letter of the pressed key
.
bool getKeyPressed ()
Detects if any key was pressed.
void enablePullUp ()
Enables internal PullUp resistors on the coloums pins.

Protected Member Functions

int getKeyIndex ()
return the index value representating the pressed key

Changes

RevisionDateWhoCommit message
21:fb28bc08ded4 2015-09-20 rlanghbv doc update default tip
20:064b86485f26 2015-09-20 rlanghbv doc update
19:0a2ec1b8bd5b 2015-09-19 rlanghbv Doc Update
18:a973524a445d 2015-09-19 rlanghbv Doc Update
17:f9b292067464 2015-09-19 rlanghbv Doc Update
16:ea3c612999ac 2015-09-19 rlanghbv Doc Update
15:78f9c379a2e1 2015-09-19 rlanghbv Doc Update
14:d6592dac4365 2015-09-19 rlanghbv Code Formated properly
13:9a52b9d7e78c 2015-09-19 rlanghbv Doc Update
12:5f7f56abfe36 2015-09-19 rlanghbv Doc Update
11:2176a5cf72b2 2015-09-19 rlanghbv Doc Update
10:d66b1727615d 2015-09-19 rlanghbv Doc Update
9:1f7793af2f64 2015-09-19 rlanghbv Newline fix in example prog
8:862b0a362754 2015-09-19 rlanghbv Doc Update
7:51ed72b695a5 2015-09-19 rlanghbv Doc Update
6:d0a45d163653 2015-09-19 rlanghbv Doc Update
5:1c26c48d5a20 2015-09-19 rlanghbv Doc Formating
4:7e46f22dc3ad 2015-09-19 rlanghbv Doc formating
3:d3772b2d763c 2015-09-19 rlanghbv Documentation update
2:cf9e1e315e74 2015-09-19 rlanghbv Documentation Update
1:fa689a04c361 2015-09-19 rlanghbv First commit
0:1fa357ea3fcc 2010-11-06 DimiterK (none)