vead
Full Member level 5
Hello
I am looking help in programming to interface keypad. I have seen many example on internet. I can't understand. I want that when I press any button on keypad. it should be display on LCD. let's suppose I have matrix keypad 16x2 LCD display and 8051
This is routine to read keypad
Now I want to make routine that will store the number of keypad. Ho to routine that will store the numbers of keypad?
I am looking help in programming to interface keypad. I have seen many example on internet. I can't understand. I want that when I press any button on keypad. it should be display on LCD. let's suppose I have matrix keypad 16x2 LCD display and 8051
This is routine to read keypad
Code:
char Read_Keypad()
{
C1=1; C2=1; C3=1; C4=1;
R1=0; R2=1; R3=1; R4=1;
if(C1==0){Delay(100);while(C1==0);return '7';}
if(C2==0){Delay(100);while(C2==0);return '8';}
if(C3==0){Delay(100);while(C3==0);return '9';}
if(C4==0){Delay(100);while(C4==0);return '/';}
R1=1; R2=0; R3=1; R4=1;
if(C1==0){Delay(100);while(C1==0);return '4';}
if(C2==0){Delay(100);while(C2==0);return '5';}
if(C3==0){Delay(100);while(C3==0);return '6';}
if(C4==0){Delay(100);while(C4==0);return 'X';}
R1=1; R2=1; R3=0; R4=1;
if(C1==0){Delay(100);while(C1==0);return '1';}
if(C2==0){Delay(100);while(C2==0);return '2';}
if(C3==0){Delay(100);while(C3==0);return '3';}
if(C4==0){Delay(100);while(C4==0);return '-';}
R1=1; R2=1; R3=1; R4=0;
if(C1==0){Delay(100);while(C1==0);return 'C';}
if(C2==0){Delay(100);while(C2==0);return '0';}
if(C3==0){Delay(100);while(C3==0);return '=';}
if(C4==0){Delay(100);while(C4==0);return '+';}
return 0;
}
Now I want to make routine that will store the number of keypad. Ho to routine that will store the numbers of keypad?