anupriya
Newbie level 5
data display in lcd
main()
{
char c='h';
int x=5;
write_char(c,x);
}
void write_instr(unsigned char instr)
{
RS=0;
RW=0;
E=0;
P3=instr>>4;
E=1;
E=0;
delay();
P3=instr&0x0F;
E=1;
E=0;
delay();
}
void write_char(char val,int p)
{
char d;
if(p=0 && p<=39)//if user given position is b/w this range then 1st line
{
write_instr(line1 + p);//the addr is added to the position value and the addr is incremented
delay();
}
else
{
write_instr(line2 + p);
delay();
}
d=val<<4;//the uppermost 4bit are taken and stored in d
E=0;
RW=1;
RS=0;
P3=d;//data is wrriten into the ddram
E=1;
RW=0;
lcd_delay();
d=(val&0x0F);
E=0;
RW=1;
P3=d;//data is eend to ddram
E=1;
RW=0;
delay();
write_instr(disp_home);//after the data is written the cursor comes to home position
delay();
}
is this correct.
plz somebody help
main()
{
char c='h';
int x=5;
write_char(c,x);
}
void write_instr(unsigned char instr)
{
RS=0;
RW=0;
E=0;
P3=instr>>4;
E=1;
E=0;
delay();
P3=instr&0x0F;
E=1;
E=0;
delay();
}
void write_char(char val,int p)
{
char d;
if(p=0 && p<=39)//if user given position is b/w this range then 1st line
{
write_instr(line1 + p);//the addr is added to the position value and the addr is incremented
delay();
}
else
{
write_instr(line2 + p);
delay();
}
d=val<<4;//the uppermost 4bit are taken and stored in d
E=0;
RW=1;
RS=0;
P3=d;//data is wrriten into the ddram
E=1;
RW=0;
lcd_delay();
d=(val&0x0F);
E=0;
RW=1;
P3=d;//data is eend to ddram
E=1;
RW=0;
delay();
write_instr(disp_home);//after the data is written the cursor comes to home position
delay();
}
is this correct.
plz somebody help