Hello
please look at attached picture there is microcontroller connected with LCD and two input switches.

I want to write c program that will do following things
* start LCD
*display message on first line" do you like dog"
*display message on second line like option " YES NO"
*if I press YES switch button than display message " you like dog"
*If I press NO switch than display message " you don't like dog"
*display message on first line" do you like CAT"
*display message on second line like option " YES NO"
*if I press YES switch button than display message " you like CAT"
*If I press NO switch than display message " you don't like CAT"
* stop LCD
what I have to write in main function to do all work ?
please look at attached picture there is microcontroller connected with LCD and two input switches.

I want to write c program that will do following things
* start LCD
*display message on first line" do you like dog"
*display message on second line like option " YES NO"
*if I press YES switch button than display message " you like dog"
*If I press NO switch than display message " you don't like dog"
*display message on first line" do you like CAT"
*display message on second line like option " YES NO"
*if I press YES switch button than display message " you like CAT"
*If I press NO switch than display message " you don't like CAT"
* stop LCD
C:
// Program for LCD Interfacing with 8051 Microcontroller
#include<reg51.h>
#define display_port P1 //Data pins connected to port 2 on microcontroller
sbit rs = P2^0; //RS pin connected to pin 2 of port 3
sbit rw = P2^1; // RW pin connected to pin 3 of port 3
sbit e = P2^2; //E pin connected to pin 4 of port 3
sbit yes = P3^0; // yes button connected to p3_0 pin
sbit No = P3^3; // no button connected to P3_3 pin
void msdelay(unsigned int time) // Function for creating delay in milliseconds.
{
unsigned i,j ;
for(i=0;i<time;i++)
for(j=0;j<1275;j++);
}
void lcd_cmd(unsigned char command) //Function to send command instruction to LCD
{
display_port = command;
rs= 0;
rw=0;
e=1;
msdelay(1);
e=0;
}
void lcd_data(unsigned char disp_data) //Function to send display data to LCD
{
display_port = disp_data;
rs= 1;
rw=0;
e=1;
msdelay(1);
e=0;
}
void lcd_init() //Function to prepare the LCD and get it ready
{
lcd_cmd(0x0d); // turn display ON, cursor blinking
}
void main()
{
lcd_init();
while (1)
{
}
}