Librería para teclados Matriciales 4x4
Dependencies: TextLCD keypad mbed
Fork of teclado by
main.cpp
00001 #include "mbed.h" 00002 #include "TextLCD.h" 00003 #include "keypad.h" 00004 00005 00006 TextLCD lcd(PTE5, PTE4, PTE3, PTE2, PTB11, PTB10); // rs, e, d4-d7 00007 00008 char Keytable[] = {'1','2','3','A', 00009 '4','5','6','B', 00010 '7','8','9','C', 00011 '*','0','#','D'}; 00012 char Index; 00013 00014 uint32_t cbAfterInput(uint32_t index) { 00015 Index=index; 00016 lcd.locate(0,0); 00017 lcd.printf(" Teclado"); 00018 lcd.locate(0,1); 00019 lcd.printf("Index:%d =>key:%c ",Index,Keytable[Index]); 00020 return 0; 00021 } 00022 00023 int main() { 00024 00025 Keypad keypad(PTA12,PTD4,PTA2,PTA1,PTC9,PTC8,PTA5,PTA4); 00026 keypad.CallAfterInput(&cbAfterInput); 00027 keypad.Start(); 00028 00029 while (1) { 00030 00031 } 00032 }
Generated on Wed Jul 20 2022 02:30:56 by 1.7.2