XBee S2B Problem

Hello Arduino-Friends,

sry for my bad English, that's my first post in this Forum and i don't know how i chance the language :frowning: i hope you can understand me. :slight_smile:

To my Project, I have:
two XBee S2B, (http://www.watterott.com/de/XBee-Pro-60mW-Series-25-Draht-Antenne)
one XBee Explorer (http://www.watterott.com/de/XBee-Explorer-USB)
one XBee Shield (http://www.watterott.com/de/Arduino-Xbee-Shield-without-Xbee-Module) and
one Arduino MEGA 2560

My final destination is, I would like building a GUI in Java, then would i use Buttons in this GUI to control the Servo-Position.

As mini-Example would i control a LED.
My Idea is:
The LED is on the Arduino MEGA, on this is moreover the XBee-Shield and on this is the XBee-Modul. As Sender would i use the XBee Explorer. On this is the second XBee-Modul.

With this Code can i control the LED on the Arduino MEGA over the Arduino-"Serial Monitor" (in the Arduino IDE)

int led = 12;

void setup(){
  Serial.begin(9600);
  pinMode(led, HIGH);
}

void loop(){
  byte daten = Serial.read();
  if(daten == '1'){
    digitalWrite(led, HIGH);
    delay(250);
  }
  
  if(daten == '0'){
    digitalWrite(led, LOW);
    delay(250);
  }  
}

But how i can send a char over the Explorer?

I would be glad to get an answer,
kind regards Matthias

Moderator edit: [code] ... [/code] tags added. (Nick Gammon)

Hello again,

i maked two Videos from my Problem:

I hope you can help me.

Lots of love Matthias