previously I learned how to display message on LCD screen. Now I want to increase complexity of program. I want to make program for following condition
if button 1 pressed than display number 1 on LCD
if button 2 pressed than display number 2 on LCD
else don't show any value

I am having problem to write program. I have knowledge of loop , conditional statement , array strings data type ...etc but I have no idea how to write program.?
if button 1 pressed than display number 1 on LCD
if button 2 pressed than display number 2 on LCD
else don't show any value

Code:
#include<reg51.h>
#define port P1 /* Data pins connected to port P1 */
sbit RS = P2^0; /* RS pin connected to pin 0 of port P2 */
sbit RW = P2^1; /* RW pin connected to pin 1 of port P2 */
sbit EN = P2^2; /* EN pin connected to pin 2 of port P2 */
sbit B1 = P3^0; /* push button 1 */
sbit B2 = P3^3; /* push button 2 */
void Delay(unsigned int wait)
{
unsigned i,j ;
for(i=0;i<wait;i++)
for(j=0;j<1200;j++);
}
/* Function to send command instruction to LCD */
void LCD_Command(unsigned char cmd)
{
port = cmd;
RS=0;
RW=0;
EN=1;
Delay(2);
EN=0;
}
/*Function to send display dato LCD */
void LCD_Data(unsigned char Data)
{
port = Data;
RS=1;
RW=0;
EN=1;
Delay(2);
EN=0;
}
/* function for delay */
/* Function to prepare the LCD */
void LCD_init()
{
LCD_Command(0x38);
Delay(20);
LCD_Command(0x0f);
Delay(20);
LCD_Command(0x01);
Delay(20);
LCD_Command(0x81);
Delay(20);
}
void main()
{
unsigned char string[15]="This is Parth";
char *buffer = string;
LCD_init();
while(*buffer)
{
LCD_Data(*buffer++);
Delay(60);
}
}
