bi-directional RF code

I have searched and searched but can not find an example of code that can give me some help in doing bi-directional rf connection.
Only code i can find is either handling a receiver or a sender.
Sadly the arduino does not handle muliti threading so all help in how to do a code for bi-directional rf would be great.
The virtual wire library is a good start and the RF hardware it operates is not to expensive.

It depends on if your RF link is half duplex or full duplex. That is are you going to be transmitting at the same time as receiving?

If half duplex then any sort of package of bytes followed by an acknowledgement system will do. Typically you could use the same protocol as RS485 with the master / slave model. Where the slave only ever responds to a pole by the master.

Aha! I am happy with half duplex, first transmitting and then receiving. Where can i find the protocol?

Will actually use a AT MEGA 644P that includes two serial ports so i can do full duplex as well. Is there any library for this or protocol?

By the way, it will be two arduinos talking with eachother no computer involved.

two serial ports so i can do full duplex as well.

It's not just the serial ports it is the RF receiver can it receive if there is a transmitter next to it. I know it will be (or should be) on a different frequency but the close proximity of a transmitter makes a receiver very insensitive unless you take precautions.

Have a look at the communications bit of the playground

Or RS485 at

I see. What about the DR3100 ?

Looks OK but is it two way enough for your needs?

Yes it should do as well if i set up a master slave function of some kind. Could also work with a ir connection of some kind. I need to get more knowledge in the wireless technology available, have been reading the palyground area but still i lack the needed skills. Thanks by the way for the reply.