Manejo básico de teclado matricial 4x4 con LCD 16x02
Dependencies: Keypad keypad mbed
Revision 0:81bc4ffbdef6, committed 2015-06-07
- Comitter:
- RafaB
- Date:
- Sun Jun 07 02:26:53 2015 +0000
- Commit message:
- Teclado 4x4
Changed in this revision
diff -r 000000000000 -r 81bc4ffbdef6 TextLCD.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Sun Jun 07 02:26:53 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/RafaB/code/Keypad/#33fad9fcd15c
diff -r 000000000000 -r 81bc4ffbdef6 keypad.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/keypad.lib Sun Jun 07 02:26:53 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/yoonghm/code/keypad/#da060f8c03e8
diff -r 000000000000 -r 81bc4ffbdef6 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Jun 07 02:26:53 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/dbbf35b96557 \ No newline at end of file
diff -r 000000000000 -r 81bc4ffbdef6 text.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/text.cpp Sun Jun 07 02:26:53 2015 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" +#include "Keypad.h" +#include "TextLCD.h" + +TextLCD lcd(PTB10, PTB11, PTE2, PTE3, PTE4, PTE5); // rs, e, d4-d7 +char key; + +// Define your own keypad values +char Keytable[] = { '1', '2', '3', 'A', + '4', '5', '6', 'B', + '7', '8', '9', 'C', + '*', '0', '#', 'D' + }; + +uint32_t cbAfterInput(uint32_t Key) +{ lcd.locate(0,0); + lcd.printf("La tecla es: "); + key=Key; + lcd.locate(0,14); + lcd.printf("%c",Keytable[key]); + return 0; +} + +int main(){ + // F0 F1 F2 F3 C0 C1 C2 C3 + Keypad keypad(PTA1,PTA2,PTD4,PTA12,PTA4,PTA5,PTC8,PTC9); + keypad.CallAfterInput(&cbAfterInput); + keypad.Start(); + + while (true) {} +} + \ No newline at end of file