Class library for a polling-based 4x4 keypad.

Fork of Keypad by Grant Phillips

Files at this revision

API Documentation at this revision

Comitter:
mijimy
Date:
Wed Jun 21 09:35:40 2017 +0000
Parent:
0:4bbd88022a6f
Commit message:
PULLUP IN IN ROW

Changed in this revision

Keypad.cpp Show annotated file Show diff for this revision Revisions of this file
Keypad.h Show annotated file Show diff for this revision Revisions of this file
diff -r 4bbd88022a6f -r dd892be4b7c7 Keypad.cpp
--- a/Keypad.cpp	Tue Apr 05 17:37:55 2016 +0000
+++ b/Keypad.cpp	Wed Jun 21 09:35:40 2017 +0000
@@ -4,7 +4,7 @@
 
 // Keypad layout:
 //                [row][col]   Col0 Col1 Col2 Col3 
-char const kpdLayout[4][4] = {{'1' ,'2' ,'3' ,'A'},  //row0
+char const kpdLayout[4][4] = {{'1' ,'2' ,'3' ,'4'},  //row0
                               {'4' ,'5' ,'6' ,'B'},  //row1
                               {'7' ,'8' ,'9' ,'C'},  //row2
                               {'*' ,'0' ,'#' ,'D'}}; //row3
@@ -23,7 +23,8 @@
 char Keypad::ReadKey() {
     char KeyValue, Done=0;
     uint16_t y, x;
-    
+     _rows.mode(PullUp); 
+
     //delay_ms(ContactBounceTime);  //warning no contact bounce protection
                                     //call read_key more than once with delay
                                     //between if key stay constant then key is pressed
diff -r 4bbd88022a6f -r dd892be4b7c7 Keypad.h
--- a/Keypad.h	Tue Apr 05 17:37:55 2016 +0000
+++ b/Keypad.h	Wed Jun 21 09:35:40 2017 +0000
@@ -76,7 +76,8 @@
  
   private:
     BusOut _cols;    
-    BusIn _rows;
+    BusIn _rows  ;
+   
 };
  
 #endif
\ No newline at end of file