interfacing keypad and lcd using pic16f877a

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

interfacing keypad and lcd using pic16f877a

Postby streetlifez » Thu Apr 14, 2011 4:22 pm

Hi, can anyone kindly help me to interface keypad and lcd? keypad would be my input and lcd will display the number that i pressed. just a quick n simply guide will do. like :

int read_keypad()
{int i=0;
ROW1();
__delay_ms(10);
if (C1==1) i=i+1;
if (C2==1) i=i+2;
if (C3==1) i=i+3;
if (C4==1) i=i+4;

but how do i display it in the lcd the number that i've pressed? pls help
streetlifez
Greenhorn
 
Posts: 2
Joined: Tue Mar 22, 2011 11:50 am

Re: interfacing keypad and lcd using pic16f877a

Postby shahrul » Thu Apr 14, 2011 9:25 pm

My code Keypad Lesson is already convert keypad button into integer.
Then, specify the keypad function into some name. Then, display that value on LCD. Can see I display number on LCD by ADC Lesson.
CODE: SELECT_ALL_CODE
keypad=read_keypad();
convert(keypad,10); //convert into decimal
lcd_goto(0x00);  //position lcd
for(i=1;i>=0;i--) display(di[i]); //display 2 digit
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 3 guests

cron