hima bindu pallanti
/
mbed_key
4*4 keypad interfacing with arm lpc1768 for entering 0-9 digits.
Revision 0:5e96fed89c06, committed 2015-10-10
- Comitter:
- himabindupallanti
- Date:
- Sat Oct 10 10:35:00 2015 +0000
- Commit message:
- Keypad interfacing for password
Changed in this revision
diff -r 000000000000 -r 5e96fed89c06 keypad.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/keypad.lib Sat Oct 10 10:35:00 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/yoonghm/code/keypad/#da060f8c03e8
diff -r 000000000000 -r 5e96fed89c06 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Oct 10 10:35:00 2015 +0000 @@ -0,0 +1,41 @@ +#include "mbed.h" + +#include "Keypad.h" + +Serial PC(USBTX, USBRX); + +// Define your own keypad values +char Keytable[] = { '1', '2', '3', // r0 + '4', '5', '6', // r1 + '7', '8', '9', + '0' // r2 + // c0 c1 c2 + }; + +int32_t Index = -1; +int State; + +uint32_t cbAfterInput(uint32_t index) +{ + Index = index; + return 0; +} + +int main() +{ + PC.printf("I am Demo Keypad\r\n"); + + // r0 r1 r2 r3 c0 c1 c2 c3 + Keypad keypad(p21, p22, p23, p24, p25, p26, p27, p28); + keypad.attach(&cbAfterInput); + keypad.start(); // energize the columns c0-c3 of the keypad + + while (1) { + __wfi(); + if (Index > -1) { + PC.printf("Interrupted"); + PC.printf("Index:%d => Key:%c\r\n", Index, Keytable[Index]); + Index = -1; + } + } +} \ No newline at end of file
diff -r 000000000000 -r 5e96fed89c06 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Oct 10 10:35:00 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68 \ No newline at end of file