![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Librería para teclados Matriciales 4x4
Dependencies: TextLCD keypad mbed
Fork of teclado by
Diff: main.cpp
- Revision:
- 0:d3c549ccf52b
- Child:
- 1:846d51d88013
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jun 07 04:19:50 2015 +0000 @@ -0,0 +1,32 @@ +#include "mbed.h" +#include "TextLCD.h" +#include "keypad.h" + + +TextLCD lcd(PTE5, PTE4, PTE3, PTE2, PTB11, PTB10); // rs, e, d4-d7 + +char Keytable[] = {'1','2','3','A', + '4','5','6','B', + '7','8','9','C', + '*','0','#','D'}; +char Index; + +uint32_t cbAfterInput(uint32_t index) { + Index=index; + lcd.locate(0,0); + lcd.printf(" Hello World!"); + lcd.locate(0,1); + lcd.printf("Index:%d =>key:%c ",Index,Keytable[Index]); + return 0; +} + +int main() { + + Keypad keypad(PTA12,PTD4,PTA2,PTA1,PTC9,PTC8,PTA5,PTA4); + keypad.CallAfterInput(&cbAfterInput); + keypad.Start(); + +while (1) { + + } +} \ No newline at end of file