Microcontroller › 8051 › Cannot Receive 4digit Integer value from serial port › still it will take the first
still it will take the first block value ,i mean the array value is not empty.
if i press another block of value then previous array value will empty.
for example
first time
when press “1234” then lcd display
if i again press only “1” of that block that time also lcd display.But i want if i again press “1234” second time then lcd will display.
after your advice i change my code in below way.
void compare()
{
if(strcmp(msg,”1234″)==0)
{
lcdcmd(0x01);
lcddata(‘B’);
i=0;
}
else if (strcmp(msg,”4321″)==0)
{
lcdcmd(0x01);
lcddata(‘C’);
i=0;
}
}
void recieve() interrupt 4
{
while (RI != 1) {;}
msg[i++] = SBUF;
RI = 0;
compare();
}
but still face problem