Query regarding C code for receiving two data one after the another.

Status
Not open for further replies.

shriram krishnan

Newbie level 4
Joined
Jan 21, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,317
I am doing a project on autonomous robo sumo's..
The problem what i am facing is that ,i am sending two values from matlab using two fprintf() one after the another using zigbee to another zigbee mounted on Robo.
So what i need is that the code in c to receive two data which i will be burning in robo for zigbee.
I know the code to receive data of one byte from zigbee which is this:-

SIGNAL(SIG_UART_RECV)
{
receive_data = UDR;

UDR = receive_data+1; // Echo the received data plus 1

}
here basically Signal function is called automatically whenever a data is received.
It just act as interrupt.
so the problem is i want to receive 16 bit value at the same time .
My zigbee only receive 8 bit i:e one char at a time.
so kindly provide me the solution. or modification in the above code to receive two char or a 16 bit value at the same time.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…