im fairly new to uc programming and im trying to write a lcd interfacing program for at89c2051.the function here accepts two strings and is used to display it on lcd. Im getting an error 141 and 202 in the second for loop. and when i delete the second for loop the error get transferred to the first for loop. What should i do . please help.??
void lcddata(unsigned char* l1 ,unsigned char* l2) { int value;
for( int i=0; char[i]!=0; i++)
{ lcdready();
value= l1[i];
ldata = value;
rs=1;
rw=0;
en=1;
msdelay(1);
en=0;
}
for( unsigned int j=0; char[j]!=0; j++) //error 141 : syntax error near ')'
value= l2[j]; //error 202 : 'j' unidentified identifier
} return;
Try this for a start.
void lcddata(unsigned char* l1 ,unsigned char* l2) { int value; for( int i=0; l1[i]!=0; i++) { lcdready(); value= l1[i]; ldata = value; rs=1; rw=0; en=1; msdelay(1); en=0; } for( unsigned int j=0; l2[j]!=0; j++) { lcdready(); value= l2[j]; ldata = value; rs=1; rw=0; en=1; msdelay(1); en=0; } return; }