simple demostration

Dependencies:   Hotboards_keypad mbed

Files at this revision

API Documentation at this revision

Comitter:
RomanValenciaP
Date:
Sat Mar 05 00:05:26 2016 +0000
Child:
1:1b1de1bdac89
Commit message:
first release - recquires approval

Changed in this revision

Hotboards_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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Hotboards_keypad.lib	Sat Mar 05 00:05:26 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/Hotboards/code/Hotboards_keypad/#e870110f753b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Mar 05 00:05:26 2016 +0000
@@ -0,0 +1,32 @@
+
+#include "mbed.h"
+#include "Hotboards_keypad.h"
+
+char keys[ 4 ][ 4 ] =
+{
+    { '1' , '2' , '3' , 'A' },
+    { '4' , '5' , '6' , 'B' },
+    { '7' , '8' , '9' , 'C' },
+    { '*' , '0' , '#' , 'D' }
+};
+
+DigitalInOut rowPins[ 4 ] = { PA_6 , PA_7 , PB_6 , PC_7 };
+DigitalInOut colPins[ 4 ] = { PA_8 , PB_10 , PB_4 , PB_5 };
+
+Keypad kpd( makeKeymap( keys ) , rowPins , colPins , 4 , 4 );
+
+Serial pc( USBTX , USBRX );
+
+int main()
+{
+    while(1)
+    {
+        char key = kpd.getKey( );
+        
+        if( key )
+        {
+            pc.printf( "%c" , key );
+            pc.printf( "\n\r" );
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Mar 05 00:05:26 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3
\ No newline at end of file