Write a program to display any name on LCD.


#include<8051.h>
void lcd_init();
void display(unsigned char d);
void lcd_cmd(unsigned char d);
void delay(unsigned int i)
{
while(i!=0)
{
i–;
}
}
void lcd_init()
{
lcd_cmd(0x38);
lcd_cmd(0x01);
lcd_cmd(0x0c);
}
void lcd_cmd(unsigned char d)
{
P1=d;
delay(300);
P3_3=0;
P3_4=1;
P3_4=0;
}
void display(unsigned char d)
{
P1=d;
delay(300);
P3_3=1;
P3_4=1;
P3_4=0;
}
void main()
{
lcd_init();
lcd_cmd(0x80);
display(‘A’);
display(‘A’);
display(‘S’);
display(‘H’);
display(‘N’);
display(‘A’);
}

Add Comment