key table
Dependencies: FPointer keypad mbed
Diff: main.cpp
- Revision:
- 0:9a880586b57e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Oct 16 18:43:40 2012 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" + #include "keypad.h" + + Serial pc(USBTX, USBRX); + + + // Define your own keypad values + char Keytable[] = { '1', '2', '3', + '4', '5', '6', + '7', '8', '9', + '*', '0', '#' + }; + + uint32_t + cbAfterInput(uint32_t index) + { + pc.printf("Code\n"); + pc.printf("Index:%d => Key:%c\n", index, Keytable[index]); + return 0; + } + + int main() + { + pc.printf("Code\n"); + Keypad keypad(p25, p26, p27, p28, p21, p22, p23, p24); + keypad.CallAfterInput(&cbAfterInput); + keypad.Start(); + + while (1) { + wait_ms(100); + } + } \ No newline at end of file