Ok, so now its the trouble shooting time. There are plenty of things to check if all the silly mistakes are accounted for but I ll get you started. Before that, I need to know, whats your output i.e. how do you know that button presses are not being recognized by the controller??
when a key is pressed, a corresponding value has to be displayed on the GLCD but in against to when a key is pressed for the first time one value is displayed and if you press the same key for the next time some different value is being displayed and if continue to press the same key continuously it continuously displays the different values.
int get_key() //function declaration for assigning the values for keys
{ int i,key_value=1;//declaration of unsigned characters i,key
for(i=0;i<8;i++)
{ PORTC |= 0xf0;
PORTC &= ~(0x80>>i);//Make rows low one by one
_delay_us(1); //Wait before reading port
if(!(PINC & (1<<PC0)))//if the condition is true assign key a value
{ while(!(PINC & (1<<PC0)));//while the condition is true always
return key_value; //return the value of key
}
if(!(PINC & (1<<PC1)))//if the condition is true assign key a value
{ key_value += 1;//defining the required value of key
while(!(PINC & (1<<PC1))); //while the condition is true always
return key_value; //return the value of key
}
if(!(PINC & (1<<PC2))) //if the condition is true assign key a value
{ key_value += 2; //defining the required value of key
while(!(PINC & (1<<PC2))); //while the condition is true always
return key_value; //return the value of key
}
if(!(PINC & (1<<PC3)))//if the condition is true assign key a value
{ key_value += 3; //defining the required value of key
while(!(PINC & (1<<PC3))); //while the condition is true always
return key_value; //return the value of key
}
key_value +=4;//defining the required value of key
}
return(0); //returning 0
}