keypad

Dependencies:   mbed TextLCD keypad

main.cpp

Committer:
detay
Date:
2019-12-04
Revision:
0:568acc58974f

File content as of revision 0:568acc58974f:

#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));
}

}
}