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.
Fork of 4x4KeyBoardExample by
Diff: main.cpp
- Revision:
- 0:c72d94fc465d
- Child:
- 2:6b74f02a9e87
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Sep 19 08:09:26 2015 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "keypad.h"
+
+Serial pc(USBTX, USBRX);
+
+
+int main() {
+ // c0 c1 c2 c3 r0 r1 r2 r3
+ Keypad keypad( PC_3,PC_2,PA_0,PA_1,PA_4,PB_0,PC_1,PC_0 );
+
+ keypad.enablePullUp();
+ char key;
+ pc.printf("Please touch a key on the keypad\n\r");
+ while (1)
+ {
+ key = keypad.getKey();
+ if(key != KEY_RELEASED)
+ {
+ pc.printf("%c\r\n",key);
+ wait(0.6);
+ }
+ }
+}
\ No newline at end of file
