Microcontroller › 8051 › Cannot Receive 4digit Integer value from serial port › Thanks a lot about your
December 10, 2014 at 9:17 am
#12408
Bakhtiar
Participant
Thanks a lot about your reply.
Ok if i use array then my program is receive using serial first time data here is my code.
void compare()
{
if(strcmp(msg,”1234″)==0)
{
lcdcmd(0x01);
lcddata(‘B’);
}
if (strcmp(msg,”4321″)==0)
{
lcdcmd(0x01);
lcddata(‘C’);
}
}
void recieve() interrupt 4
{
int i;
while (RI != 1) {;}
msg[i++] = SBUF;
RI = 0;
compare();
}
for example: after running the code it take any one of the input
if input “1234”
then it worked.
but at the same time when i input
“4321”
it will not take.
please help me