2

I will explain my task in a simplified way. I'm communicating among 3 Xbee's.

The attached code is for the sender Xbee. This Xbee actually sends multiple values of value1 (here for simplification I assigned it to constant value 10). For finding the value1 it does some other calculations as well and then assigns it.

But I find that if I reduce or remove the delay(100) I end up receiving improper values. I guess delay gives a buffer time for data transmission but my question is how to do I calculate the minimum delay or how can justify that this is the delay needed ?

I hope you can understand my question. If not please comment I will give some more pertinent details.

 // Sender Xbee
 void setup()
 {
 Serial.begin(9600);
 }
 void loop()
 {
 int value1 = 10; // some hardcoded values to send
 Serial.print('H'); // unique header to identify start of message
 Serial.print(value1,DEC);
 Serial.print(","); // note that a comma is sent after the last field
 Serial.print('\n'); // send a cr/lf
 delay(100);
 }
asked Apr 20, 2017 at 7:19
1
  • If timing is critical (and assuming you do not want to loose any message), you probably need some notification back that the message has been received correctly (possibly with a checksum value). Commented Apr 20, 2017 at 16:11

1 Answer 1

1

Based on my experience with Xbee, I would say the limit is 50ms as Xbee can do the lowest sampling rate of 50ms.

Nick Gammon
38.9k13 gold badges69 silver badges125 bronze badges
answered Apr 21, 2017 at 15:30

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.