Tests forked Keypad library.

Dependencies:   FPointer keypad mbed

Schematic:

http://schind.nl/keypad.png

No extra hardware is needed besides the wires and switches. The columns are outputs configured with open drain. The rows are inputs configured with pull up resistors. A key press pulls down its row. With scanning the column is determined thereafter.

See keypad for the forked library used in this project.

Files at this revision

API Documentation at this revision

Comitter:
gj_schoneveld
Date:
Sat Nov 03 23:45:20 2012 +0000
Parent:
1:8bbe2b267de6
Child:
3:fb173f712440
Commit message:
Added polling support.

Changed in this revision

keypad.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
--- a/keypad.lib	Sat Nov 03 21:48:39 2012 +0000
+++ b/keypad.lib	Sat Nov 03 23:45:20 2012 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/gj_schoneveld/code/keypad/#9a9ec143840b
+http://mbed.org/users/gj_schoneveld/code/keypad/#e6623f165199
--- a/main.cpp	Sat Nov 03 21:48:39 2012 +0000
+++ b/main.cpp	Sat Nov 03 23:45:20 2012 +0000
@@ -28,10 +28,24 @@
     printf("*** Keypad Demo ***\n");
 
     Keypad keypad(p25, p26, p27, p28, p21, p22, p23, p24);
+
+// interrupt mode
     keypad.CallAfterInput(&cbAfterInput);
-
     keypad.Start();
     while (1) {
         Sleep();
     }
+    
+// polling mode
+/*
+    keypad.Start();
+    
+    int key = -1;
+    while (1) {
+        key = keypad.DebouncedScan();
+        if (key >= 0)
+            cbAfterInput(key);
+        wait(0.1);
+    }
+*/
 }
\ No newline at end of file