Coding check for Wireless Xbee/arduino Communication

Hey guys I am attempting to configure a network consisting of arduino/xbee connections. I want to set up three switches, that when pressed will be able to turn on and off three separate lights. The following code is what I have constructed so far. What my goal is to do is be able to send binary over the serial port so the other xbee's will see the binary functions to turn lights on and off instead of only sending an 'A', or a 'B' for the switch case statement. How can I make this viable? Thank ya'll for your help.

int Button1= 2;
int Button2= 3;
int Button3= 4;
int buttonState1 = 0;
int buttonState2 = 0;
int buttonState3 = 0;
int ledPin1 = 0;
int ledPin2 = 0;
int ledPin3 = 0;

void setup() {

  //Start the serial communication
  Serial.begin(9600); //Baud rate must be the same as is on xBee module

pinMode(Button1, INPUT);
pinMode(Button2, INPUT);
pinMode(Button3, INPUT);

}

void loop() {
       //reading state of button
buttonState1 = digitalRead(Button1);
buttonState2 = digitalRead(Button2);
buttonState3 = digitalRead(Button3);

if (buttonState1 == HIGH) {
  //Turn on led to indicate which function is being executed
  digitalWrite(ledPin1, HIGH);
  digitalWrite(ledPin2, LOW);
  digitalWrite(ledPin3, LOW);
  
  //Send function to recievers to tell them to wake up
  Serial.println(1000);
  
   Serial.println("Button 1 Turning On");
  //delay to help keep data transmission clean
  delay(20);
}
if (buttonState2 == HIGH) {
  //Turn on led to indicate which function is being executed
  digitalWrite(ledPin1, LOW);
  digitalWrite(ledPin2, HIGH);
  digitalWrite(ledPin3, LOW);
  
  //Send function to recievers to tell them to wake up
  Serial.println(1001);

   Serial.println("Button 2 Turning On");
  //delay to help keep data transmission clean
  delay(20);
}
if (buttonState3 == HIGH) {
  //Turn on led to indicate which function is being executed
  digitalWrite(ledPin1, LOW);
  digitalWrite(ledPin2, LOW);
  digitalWrite(ledPin3, HIGH);
  
  //Send function to recievers to tell them to wake up
  Serial.println(1010);
  Serial.println("Button 3 Turning On");
  //delay to help keep data transmission clean
  delay(20);
}
}

Code for the receiver

//Constants for led pins
const int ledPin1 = 3;
const int ledPin2 = 4;
const int ledPin3 = 5;
const int ledPin4 = 6;
//initiallizing relays for the light switches / fans
const int Relay1 = 6;
const int Relay2 = 7;
const int Relay3 = 8;

int incomingByte = 0;  
void setup() {

  //Start the serial communication
  Serial.begin(9600); //Baud rate must be the same as is on xBee module
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  
  pinMode(Relay1, OUTPUT);
  pinMode(Relay2, OUTPUT);
  pinMode(Relay3, OUTPUT);
}

void loop() {
  
  while (Serial.available()>0){
    //Read the incoming byte
    incomingByte = Serial.read();
  
    switch (incomingByte) {


case '1000': // Initialization to the Environmental Control Unit and wakeup
digitalWrite(ledPin1, HIGH); //Flashing all indicator LED's to confirm functionality and entrance to ECU
digitalWrite(ledPin2, HIGH);
digitalWrite(ledPin3, HIGH);
digitalWrite(ledPin4, HIGH);
delay(150);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, LOW);
delay(150);
digitalWrite(ledPin2, HIGH);
digitalWrite(ledPin3, HIGH);
digitalWrite(ledPin4, HIGH);
delay(150);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, LOW);
 
Serial.println("Initialization to ECU"); // Prints out “Motor 1 Forward” on the serial monitor
Serial.println("   "); // Creates a blank line printed on the serial monitor


break;
   }

case 1001: //Turn first light on
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, HIGH);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, LOW);

digitalWrite(Relay1, HIGH); //Set relay to first light switch on high
Serial.println("First light turn ON");
Serial.println("   ");
break;

case 1010: //Turn first light off
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, LOW);

digitalWrite(Relay1, LOW); //Set relay to first light switch on high
Serial.println("First light turn OFF");
break;

case 1011: //Turn second light on
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, HIGH);
digitalWrite(ledPin4, LOW);

digitalWrite(Relay2, HIGH); //Set relay to first light switch on high
Serial.println("Second light turn ON");
break;

case 1100: //Turn second light off
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, LOW);

digitalWrite(Relay2, LOW); //Set relay to first light switch on high
Serial.println("Second light turn OFF");
break;

case 1101: //Turn third light on
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, HIGH);

digitalWrite(Relay3, HIGH); //Set relay to first light switch on high
Serial.println("Third light turn ON");
break;

case 1110: //Turn third light off
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, LOW);
digitalWrite(ledPin3, LOW);
digitalWrite(ledPin4, LOW);

digitalWrite(Relay3, LOW); //Set relay to first light switch on high
Serial.println("Third light turn OFF");
break;
 }

Let me know what ya'll think. Thank you for your input

What my goal is to do is be able to send binary over the serial port so the other xbee's will see the binary functions to turn lights on and off instead of only sending an 'A', or a 'B' for the switch case statement.

How is sending 0 or 1 better than sending 'A' or 'B'?

Which XBees do you have? How are they configured? How are they connected to the Arduino(s)?

Sending "1000" or "1001" or "1010" is NOT sending binary data.

int incomingByte = 0;

This is stupid. If the type is int, get Byte out of the name!

case '1000':

Single quotes are for single characters. Please post a picture of your keyboard, or just the far right end, with the 1000 key circled. Must have one hell of a wide keyboard...

The incomingInt will NEVER equal the multibyte character literal '1000'.

You need to decide just what you want to send, and why, and write the reader code to read what you sent.

I have three xbee's series 2 S2C modules. I am configuring them with X-ctu and the xbee explorer and then I am attaching them to the arduino uno's via Xbee shield with header pins out to the relays/LED's for testing until everything is working. My question is that my sponser for our project is wanting the data that is sent to the xbee's to be in binary. I also agree with you that I could simply use 'A' 'B' or 'C', but that is not what he wants. He wants the transmissions to be sent out as binary functions. Should this not be a viable option that would be great and I can switch it back around and there wont be a problem. Do you believe this code is viable? And thank you for getting back to me and I appreciate your time. Let me know if there is any other information you need to better help me.

Also if I have this set up to send 'A' or 'B' or 'C'... when i send those from the transmitter along with a serialprintln("Activating First light"). Will the receiver code get triggered by the 'A' from "Activating first light"? if the receiver code is set up to be case 'A': do something?

Sending the data in binary IS possible. Just Serial.write() 0, 1, or 2. Or any value less than 255.

You can not use the serial port to send data to the XBee AND to the PC.

"You can not use the serial port to send data to the XBee AND to the PC."

Well, you can, but if they then both respond at the same, the Rx data coming back will be corrupted. I've done this to use the PC as listen-only protocol analyzer to check on messages from the Arduino to something else.
Just don't send from the PC to avoid corrupting data from the other guy. And some things the Arduino sends may be unprintable characters on the PC side.

CrossRoads:
"You can not use the serial port to send data to the XBee AND to the PC."

Well, you can, but if they then both respond at the same, the Rx data coming back will be corrupted. I've done this to use the PC as listen-only protocol analyzer to check on messages from the Arduino to something else.
Just don't send from the PC to avoid corrupting data from the other guy. And some things the Arduino sends may be unprintable characters on the PC side.

What is the XBee, or device on the other end of the other XBee, supposed to do with the data that is supposed to go only to the PC? How is the other device supposed to know that the serial data was not meant for it?

Sure, if you address these issues, you can use one Serial instance to talk to any number of things. But, that requires a lot of work. Far simpler to use two different ports for two different purposes.

Well there will be an arduino attached to the Xbee. So when the Xbee receives the input wirelessly from the coordinator it will tell the arduino. The arduino will then switch the relays on allowing current to go through the switch in the wall turning the light on.