![](/media/cache/group/mehmet_akif_arvas.jpg.50x50_q85.jpg)
Keypad kullanimi
Dependencies: mbed mbed-rtos MFRC522 TextLCD keypad
Diff: main.cpp
- Revision:
- 0:66860685087d
- Child:
- 1:2fd11c224867
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 09 08:07:49 2019 +0000 @@ -0,0 +1,22 @@ + #include "mbed.h" + #include "Keypad.h" + +Keypad key(PC_4, PB_13, PB_14, PB_15, PB_1, PB_2, PB_12, PA_11); + + char key_table[] = { + '1', '2', '3', 'A', + '4', '5', '6', 'B', + '7', '8', '9', 'C', + '*', '0', '#', 'D' + }; + Serial pc(USBTX,USBRX); + int main() { + pc.baud(250000); + uint32_t key_num; + while(true) { + while ((key_num = key.read()) != 0){ + pc.printf("%c\r\n", *(key_table + key_num-1)); + } + + } + } \ No newline at end of file