Hi,
I'm new to using XBee modules and I currently have a project which requires me to send data via an XBee module and I wanted to know if the serial buffer stores data after the end of a void loop{} or the arduino has been turned off.
I plan on sending 24 bytes of data and I wanted to know if i need to include an error check to discard remnants of the past usage
It is always more robust to have a error check in the code.
R_Thompson:
Hi,
I'm new to using XBee modules and I currently have a project which requires me to send data via an XBee module and I wanted to know if the serial buffer stores data after the end of a void loop{} or the arduino has been turned off.
I plan on sending 24 bytes of data and I wanted to know if i need to include an error check to discard remnants of the past usage
Depending on which Arduino you use, there is up to a 64 byte transmit and receive buffer. Calls to Serial.print() transfer the info to the buffer then return, (unless the buffer is full, then the call hangs until enough of the buffer has been send to make space for the new data).
Call Serial.flush(); to wait for the tx buffer to be send. Serial.flush() will not return until the hardware has completely send the last byte in the buffer.
Chuck.
Check out my Kickstarter Project Memory Panes an expansion RAM Shield for Mega2560's. It adds 1MB of RAM for those projects where 8KB is not enough.
s