XBee S2 Sending data from Coordinator to Router - Arduino


I am working on a project and I got three XBees modules S2. I’m trying to use Arduino to comunicate them. Now I’m using the NodeDiscovery function (in the Coordinator code), wich reports me back the address of the two Routers. So I save the Address of each router in an array, for example: matDevices[100][8]. 100 the total devices we could found and 8 the length of the address.

The code would be something like this:


int matDevices[100][8];

//In the NodeDiscovery Function
Serial.print(“Sending command to the XBee “);

while(xbee.readPacket(timeout)) { // should be receiving AT command responses
  if (xbee.getResponse().getApiId() == AT_COMMAND_RESPONSE) {
    if (response.isOk()) {
      for (int i = 2; i < 10; i++) {
        matDevices[nodeCount-1][i]=response.getValue()[i]; //get address of every Router discovered




Sorry if it’s a little weird.

But I would like to be able to send data this way: XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0xXXXXXXXX);

it is possible to send data once I have saved the address in an array, I mean, do I have to send data creating the variable XBeeAddress64 addr64, or it is possible to do it with the same array?

Thank you all and excuse about my poor english at some parts, Spanish over her


This is the wrong forum for this kind of question. You really need to ask this question on a forum for the Arduino.

Digi Support

You may want to post this code on stackoverflow.com for help.