keypad

Dependencies:   mbed TextLCD keypad

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "TextLCD.h"
00003 #include "Keypad.h"
00004 TextLCD lcd(PB_0,PA_4,PC_3,PC_2,PB_3,PA_10);
00005 Keypad key(PC_12, PC_10, PC_11,PD_2,PA_13,PA_14,PA_15,PC_8);
00006 char key_table[] = { 
00007 '1', '2', '3', 'A',
00008 '4', '5', '6', 'B',
00009 '7', '8', '9', 'C',
00010 '*', '0', '#', 'D'
00011 };
00012 int main() {
00013 uint32_t key_num;
00014 while(true) {
00015 
00016 while ((key_num = key.read()) != 0){
00017 lcd.locate(0,0);
00018 lcd.printf("Sectiginiz Rakam:%c", *(key_table + key_num-1));
00019 }
00020 
00021 }
00022 }