Zgbee and Bluetooth with Arduino

Hi,
I am working on with interfacing of bluetooth and zigbee to arduino,
but I am not able to access Tx Rx of both (zigbee and bluetooth) at a time,

if I am writing

void setup()
{
bluetooth.begin(9600);
zigbee.begin(9600);

}

in void loop only zigbee code is working.

Can you help me that how can Tx Rx of both can work at a time.

Can you help me that how can Tx Rx of both can work at a time.

Without knowing what bluetooth and zigbee are instances of? No.

If they are both instances of SoftwareSerial, the answer is simple. You can't.

Hi Paul,

yes both are instance of SoftwareSerial,

#include <SoftwareSerial.h>
SoftwareSerial bluetooth(2,3);
SoftwareSerial zigbee(4,5);

void setup()
{
bluetooth.begin(9600);
zigbee.begin(9600);
}

is there any alternate solution for this, if I want to interface bluetooth, zigbee and wifi with Arduino?

is there any alternate solution for this, if I want to interface bluetooth, zigbee and wifi with Arduino?

Yep. Get a Mega.

thanks for your quick reply,

Do Arduino Mega will surely solve this problem?
May I know what is the problem (technically) in Arduino Uno?

Do Arduino Mega will surely solve this problem?

I know that the Mega has 4 hardware serial ports, so it can talk to 4 serial devices at the same time.

May I know what is the problem (technically) in Arduino Uno?

Only one instance of SoftwareSerial can be listening at a time, due to the fact that it uses pin change interrupts. So, when a pin changes state, an interrupt is triggered and the SoftwareSerial instance that is listening gets a method called. There is no way to ask each instance if it is interested in knowing that a pin has changed state, because the changes happen too fast to poll each instance to see if it cares (yes, that is my pin, so I care; no, that isn't my pin, so I don't care).

Thanks Paul,