Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Hotboards_keypad mbed
Diff: main.cpp
- Revision:
- 0:62b7e7dd5ba4
- Child:
- 1:1b1de1bdac89
--- /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" );
+ }
+ }
+}