Delay in sensor reading update

Hi PaulS,

Pick up the pace. 115200 is 6 times as fast.

The control unit that I am using recommended me that I "should" use 19200 bps for serial communication. However, the next highest transmission rate that it offers is 38400 bps. I tried that as well and I started getting a lot of corrupted data coming in( i.e. a lot of data bytes repetition and zeros in between the data bytes). The interesting thing is that when I set it back to 19200 bps again it worked fine. I also like to mention that I did not forget to update the baud rate on my code and Xbees when I switched the baud rates, so corrupted data would not have anything to do with that.

What baud rate are the XBees using?

19200 bps

Ugh!

Code:

if(data[0] == 0x82 && data[1] == 0x81 && data[2] == 0x80)

would be a lot more readable.

Sorry about the readability :sweat_smile:. I was very excited with pointers and thinking about them when I was writing that code, even though I am aware of their connection with arrays. Nonetheless, I really appreciate it that you pointed that out. :slight_smile:

Do you really need to send so much useless text? "A,xx.xxx; T,xx.xxx; E,xx.xxx; B,xx.xxx; O,xx.xxx!" would convey the same information in a lot fewer byte. And, the receiver would KNOW when the end of a packet had arrived.

I am using those text to display the data on a window that I created using Processing. May I ask for example, how would you have it?
Also if you think it helps, I can post the code I am using on Processing as well. :smiley: