keypad
Dependencies: mbed TextLCD keypad
Diff: main.cpp
- Revision:
- 0:568acc58974f
diff -r 000000000000 -r 568acc58974f main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Dec 04 12:09:44 2019 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#include "TextLCD.h" +#include "Keypad.h" +TextLCD lcd(PB_0,PA_4,PC_3,PC_2,PB_3,PA_10); +Keypad key(PC_12, PC_10, PC_11,PD_2,PA_13,PA_14,PA_15,PC_8); +char key_table[] = { +'1', '2', '3', 'A', +'4', '5', '6', 'B', +'7', '8', '9', 'C', +'*', '0', '#', 'D' +}; +int main() { +uint32_t key_num; +while(true) { + +while ((key_num = key.read()) != 0){ +lcd.locate(0,0); +lcd.printf("Sectiginiz Rakam:%c", *(key_table + key_num-1)); +} + +} +} \ No newline at end of file