The algorithm and detailed explanation for keypad interfacing is given in above mentioned article. The brief steps to interface the keypad with AVR are written below:
1. Configure the row pins or column pins.
2. Make all output pins to low and input pins to high.
3. Keep monitoring the port value, where the key pad is connected.
4. If there is any change in port value, make one of the output pin of port to zero and rest all high.
5. If any of input pin found zero, write the particular pin data to LCD, else continue with the step (4).