Go Down

Topic: How (Arduino+two xbee pro )-Rx.connected with ..(Arduino+one xbee pro)Tx .? (Read 3111 times) previous topic - next topic

i have some problem about how receiving data by using two XPB24Z7 'xbee pro'
Note : am using SoftwareSerial.h to can connect the two xbee to one arduino 'uno' and using more than Tx and Rx at the arduino
,they are connected to same arduino 'uno' and data transmit from third xbee pro connected to another arduino 'uno' or pc
arduino code for Rx

#include <SoftwareSerial.h>

SoftwareSerial mySerial1(10, 11); // RX, TX
SoftwareSerial mySerial2(2, 3); // RX, TX
void setup() {

Serial.begin(9600);
mySerial1.begin(9600);
mySerial2.begin(9600);
pinMode(13, OUTPUT); //set pin 13 as output
}

void loop() {
// mySerial1.println("Hello, world?");
// delay(1000);

while(mySerial1.available()){ //is there anything to read?
char getData = mySerial1.listen(); //if yes, read it
if(getData == 'a'){
Serial.println('M1');   
digitalWrite(13, HIGH);
delay(200);
}else if(getData == 'b'){
digitalWrite(13, LOW);
Serial.println('H1');   
}
}
}

Runaway Pancake

Out of the box, the XBees are capable of simple two-station data exchange ( A-->B, A<--B ).

To have 3 XBees requires configuring them for networking, as a "star" ( A-->B, A<--B; A-->C, A<--C )
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy