4x4 Keypad program using polling

Dependencies:   KeypadLib mbed

Fork of 4x4KeyBoardExample by Rune Langoy

Files at this revision

API Documentation at this revision

Comitter:
fitri
Date:
Thu May 17 08:13:54 2018 +0000
Parent:
2:6b74f02a9e87
Commit message:
KEYPAD LCD JADI

Changed in this revision

KeypadLib.lib Show annotated file Show diff for this revision Revisions of this file
TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 6b74f02a9e87 -r f973bf5ad35d KeypadLib.lib
--- a/KeypadLib.lib	Thu May 17 07:48:58 2018 +0000
+++ b/KeypadLib.lib	Thu May 17 08:13:54 2018 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/rlanghbv/code/KeypadLib/#fb28bc08ded4
+https://os.mbed.com/users/fitri/code/KeypadLib/#8909e7419412
diff -r 6b74f02a9e87 -r f973bf5ad35d TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Thu May 17 08:13:54 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/simon/code/TextLCD/#308d188a2d3a
diff -r 6b74f02a9e87 -r f973bf5ad35d main.cpp
--- a/main.cpp	Thu May 17 07:48:58 2018 +0000
+++ b/main.cpp	Thu May 17 08:13:54 2018 +0000
@@ -1,7 +1,9 @@
 #include "mbed.h"
 #include "keypad.h"
+#include "TextLCD.h"
  
 Serial pc(USBTX, USBRX); 
+TextLCD lcd(D8, D9, D4, D5, D6, D7);
 
  
 int main() {
@@ -10,12 +12,15 @@
        
     keypad.enablePullUp();
     char key;
+    lcd.printf("key =");
     pc.printf("Please touch a key on the keypad\n\r");
     while (1) 
     {
          key = keypad.getKey();    
          if(key != KEY_RELEASED)
          {
+              lcd.locate (4,1);
+             lcd.printf("%c",key);
              pc.printf("%c\r\n",key);
              wait(0.6);
          }