0% found this document useful (0 votes)
11 views2 pages

LCD Ele - Docx2

Uploaded by

rutujaphalke36
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

LCD Ele - Docx2

Uploaded by

rutujaphalke36
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

/* Write a program to display string “ELECTRONICS” on LCD*/

#include<reg51.h>
Sfr ldata=0x80;
Sbit rs=P1^0;
Sbit en=P1^1;

Void MsDelay(unsigned int itime)


{
Unsigned int I,j;
For(i=0;i<time;i++)
For(j=0;j<1275;j++)
}
Void lcdcmd(unsigned char value)
{
ldata=value;
rs=0; //command register
en=1;
MsDelay(10);
en=0;
Return;
}
Void lcdcmd(unsigned char value)
{
ldata=value;
rs=0; //data register
en=1;
MsDelay(10);
en=0;
Return;
}
Void main()
{
Unsigned char text[]={“ELECTRONICS”};
Unsigned char x;
Lcdcmd(0x38); //2 lines 5*7 matrix
MsDelay(20);
Lcdcmd(0x0e); // display on cursor on
MsDelay(20);
lcdcmd(0x01); //clear display
MsDelay(20);
Lcdcmd(0x06); //shift cursor to right
MsDelay(20);
Lcdcmd(0x80); //move cursor to first line
MsDelay(20);
For(x=0;x<11;x++)
{
Lcddata(text[x]);
MsDelay(20);
}
While(1);
}

You might also like