I want make routine in c programming that will read keypad get the key from keypad
This picture is just for example to show keypad
I have studied about matrix keyboard and after that I have created this table to scan keypad. Is it right logic to read keypad ? I tried to make flow chart but I don't understand where to start. while making flowchart i was not deciding where to go.
I have made a routine. I know this will not work in programming. we don't write program like this . There are many errors in this routine . But I think this can be make better
This picture is just for example to show keypad
I have studied about matrix keyboard and after that I have created this table to scan keypad. Is it right logic to read keypad ? I tried to make flow chart but I don't understand where to start. while making flowchart i was not deciding where to go.
I have made a routine. I know this will not work in programming. we don't write program like this . There are many errors in this routine . But I think this can be make better
C:
unsigned char Read_key(void)
{
char Port_Data = 0000 0001;
char R;
for( R = 0; R < 4; R++ )
{
KEY_PORT = Port_Data;
if(!C1)
if(!C2)
if(!C3)
Port_Data <<= 1;
}
return key;
}
Last edited: