Go Down

Topic: Fio + Xbee communication and variables transfer (Read 1 time) previous topic - next topic

PaulS

Quote
I cannot get under some 100ms

You've got to provide a clue as to what happens when you try.

owar

When I try to set the delay to something lower than 50ms on the TX side the RX side will not recognize the packet(nothing on the terminal is printed).

PaulS

Did you change
Code: [Select]
  if(mySerial.available()==7){ //check if 7 bytes are available
to
Code: [Select]
  if(mySerial.available() >= 7){ //check if at least 7 bytes are available
like I suggested?

owar

Yes but it had no effect.I am allways sending 7 bytes so this should be okay.

owar

I have changed the TX code like this
Code: [Select]
void loop() {

//increase the values to simulate variables change
  x++;
  y++;
  z--;

  SEND(2,x,y,z); // send variables x,y,z with ID=2
  delay(z);
  SEND(3,a,b,c); // send variables a,b,c with ID=3
  delay(z);

}


so  with each SEND() the delay will be decreased.

on the RX side I am printing to terminal just the z variable and the output is here:
Quote
9
9
8
8
7
7
6
6
5
5
4
4
3
3
2
2
1
1
0
0
255
255
254
254


so it looks like very short delay can be achieved.But when I set the delay manualy to 10ms the RX side is getting nothing again :(

Go Up