Communication with arduino and xbee

Hi all, I'm Luca and I'm new in this forum. I immediately explain my problem, I dispose of

3 x Arduino uno
3 x xbee usb adapter
3 x xbee s1.

I have to write a sketch for an xbee module so that I pass ID, DH, DL, MY of the remaining 2 xbee modules to put them in communication. I'm trying in every way to pass the commands to but always with a negative sign. Can someone help me? I'm new to the Arduino world.

Please post your full sketch. If possible you should always post code directly in the forum thread as text using code tags (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then it's OK to add it as an attachment. Don't put your code in some external file service like dropbox, etc. We shouldn't need to go to an external website just to help you.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you're using the Arduino Web Editor then you will not have access to this useful tool. I recommend using the standard Arduino IDE instead.

When your code requires a library that's not included with the Arduino IDE please post a link (using the chain links icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

void setup()
{
  Serial.begin(9600);
  Serial.flush();
}

boolean primed = false;
boolean primed1 = false;

void loop()
{
  while (Serial.available())
  {
    Serial.read();
  }
  
  if (!primed)
    prime();
  Serial.print("H");
  delay(1000);
  Serial.print("L");
  delay(1000);
  if (!primed1)
    prime1();
  Serial.print("H");
}


void prime()
{
  delay(1500);
  Serial.print("+++");

  delay(1500);
  //Serial.print("ATID=1234\r");
  Serial.print("ATDH=13A200\n");
  Serial.print("ATDL=4048407D\n");
  Serial.print("ATSH=13A200\r");
  Serial.print("ATSL=4065BA0D\r");
  Serial.print("ATWR\r");
 Serial.print("ATCN\r");
  delay(1000);

  if (Serial.available())
  {
    primed = true;
    Serial.print(Serial.read());
  }
}


void prime1()
{
  delay(1500);
  Serial.print("+++");

  delay(1500);
  //Serial.print("ATID=1234\r");
  Serial.print("ATDH=13A200\n");
  Serial.print("ATDL=4048407D\n");
  Serial.print("ATSH=13A200\r");
  Serial.print("ATSL=4054C64C\r");
  Serial.print("ATWR\r");
  Serial.print("ATCN\r");
  delay(1000);

  if (Serial.available())
  {
    primed1 = true;
    Serial.print(Serial.read());
  }
}

this sketch must turn on and off the led of an arduino, and keep the led of the second arduino! only the first communication works, the LED goes on and off and the other arduino does not communicate