Problem with XBee

Any one is got exp on MaxStream XBee wireless communication? I tried to do a one way communication from one Arduino to another but not sure what problem is. I set up one transmitter with a push button and tried to light leds up on receiver end when button is pushed. here is my code: Transmitter Code: const int ledPin = 13; const int buttonPin = 12; char outBabe = 0;

int actPin = 0;

void setup() { pinMode(ledPin, OUTPUT); pinMode(buttonPin, INPUT); Serial.begin(9600); delay(1000); Serial.print("+++"); // write +++ to enter configuration mode delay(1000); // if (returned() == 'T') // {} // else // { // setup(); // } Serial.println("ATID3332,DH0x0000,DL0x0001,CN"); //make sure use same setting, ch, addr of receiving //Destination low at 0 //Destination hight at 1 delay(1000); // if (returned() == 'T') // {} // else // { // setup(); // } }

void loop() { actPin = digitalRead(buttonPin); if (actPin == HIGH) { outBabe = '1'; digitalWrite(ledPin,HIGH); } else { outBabe = '0'; digitalWrite(ledPin,LOW); } Serial.println(outBabe); }

and here is the receiver code

int ledPin = 13; // a byte to receive data: char inBabe = 0;

void setup() { pinMode (ledPin, OUTPUT); Serial.begin(9600); delay(1000); Serial.print("+++"); // write +++ to enter configuration mode delay(1000);

//if (returned() == 'T') //{} //else //{ // setup(); //} Serial.println("ATID3332,MY0x0001,CN"); //setting network id to 3332 //channel to ch0 //address of module to 0x0000 delay(1000); //if (returned() == 'T') //{} //else //{ // setup(); // if MS XBee is not rdy do it over //}

}

void loop() { if (Serial.available() > 1) { inBabe = Serial.read(); } if (inBabe == '1') { digitalWrite(ledPin,HIGH); delay(1000); } else { digitalWrite(ledPin,LOW); }

}

Do you really need to dynamically modify the address of the XBee that you are sending from? Do you really need to dynamically modify the address of the XBee that is receiving? These values are typically set up using X-CTU before the XBee is installed in the shield.

Which XBees do you have?

MaxStream XBee 802.15.4 OEM RF Modules not the pro ones.

i m not sure if i need to modify the address just saw it on the website and tried it out.

If you are not sure that you need to dynamically set the address, rest assured that you do not.

Use X-CTU to set the PAN ID, MY, DH, and DL values on each XBee. Make sure that DL on one is MY on the other.

Then, just write to the serial port to send, and read from the serial port to receive.

U mean DL and MY have to be the same or not? I m not use X-CTU but that shouldnt be a problem.

When you want one XBee to talk to another, you have to tell the XBee who to talk to. That's done by specifying the DH/DL value. Each XBee has a MY address.

To get a pair to talk, MY on one needs to be the DL value on the other.

As an example: XBee 1 PAN = 183 DH = 0 DL = 14 MY = 27

XBee 2 PAN = 183 (same as other XBee) DH = 0 DL = 27 (MY of other XBee) MY = 14 (DL of other XBee)

I m not use X-CTU but that shouldnt be a problem.

How else are you going to (statically) configure them?

I was using Arduino 0018 download from the website, but ill try the software u mentioned