try1 with keypad

Dependencies:   keypad mbed

Revision:
0:5151ad0261b3
Child:
1:a045dce72999
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/keyo.cpp	Tue Nov 07 00:31:36 2017 +0000
@@ -0,0 +1,30 @@
+#include "mbed.h"
+#include "Keypad.h"
+ 
+ // Define your own keypad values
+ char Keytable[] = { '1', '2', '3', 'A',   // r0
+                     '4', '5', '6', 'B',   // r1
+                     '7', '8', '9', 'C',   // r2
+                     '*', '0', '#', 'D',   // r3
+                   };
+                  // c0   c1   c2 
+ 
+ uint32_t Index;
+ 
+ uint32_t cbAfterInput(uint32_t index) {
+     Index = index;
+     return 0;
+ }
+ 
+ int main() {
+                 // r0    r1    r2    r3    c0     c1     c2     c3
+     Keypad keypad(PTE5, PTE4, PTE3, PTE2, PTB11, PTB10, PTB9, PTB8);
+     keypad.attach(&cbAfterInput);
+     keypad.start();  // energize the keypad via c0-c3
+ 
+     while (1) {
+         __wfi();
+         printf("Interrupted\r\n");
+         printf("Index:%d => Key:%c\r\n", Index, Keytable[Index]);
+     }
+ }
\ No newline at end of file