2 arduinos and a XBee 900mhz

I was wondering is it possible to have say 2 arduinos send info to the Din pin on the XBee and have it transmitt both the data packets seperatley? Do I have to do something special to not get each message mixed with the other. It will be transmitting the info back to a laptop that will display each data set seperatley is the end goal. If anyone knows of any examples of this it would be appreciated I tried looking it up and have not had much luck finding something similar done.

You would be better off have one Arduino send data to the other Arduino, and having just one talk to the XBee. The Arduino that talks to the XBee can send data to the XBee in such as way that the PC knows which Arduino it came from.

Use NewSoftSerial on the Arduino that talks to the XBee, to read from the other Arduino’s TX pin (and write to it’s RX pin).

Then, send messages like <1:FromArduinoOne> and <2:FromArduinoTwo> where FromArduinoOne is replaced by the real string to send, and FromArduinoTwo is replaced with the data read from the other Arduino using NewSoftSerial.

Otherwise, you run the risk of both Arduinos trying to send at the same time. In that case, there would be no way to determine which data came from which Arduino.

Your way makes sense to me and will give it a shot. But also brought up another question. Wouldnt I just be able to say arduino1 sends packet this often and the other packet when the first ones are not sending? Or is that just making it even more difficult? The reason I ask is later the project wont be 2 arduinos but an arduino and a gumstix overo. Thanks so far for you incite

If you tell device one that it can send once a minute, and tell device two that it can send once a minute, then you still need some way to tell the two devices not to send at the same time.

If you tell device one to send once a minute, when seconds == 0, and device two to send once a minute, when seconds == 30, you might think you are safe. But that assumes that the clocks on the two devices start synchronized, and stay synchronized.

Of course, you could have device one tell device two when to transmit, but, then you might as well have device one ask device two what to transmit, and simply transmit the reply.

Thanks a million you cleared everything up for me better than I could have hoped :)