XBee data transmission

I’m using 2 XBees to communicate wirelessly between Mega boards, but I can’t verify if any data is actually being sent. I know from the shields’ LEDs that the XBees are connected on the same network. I was attempting to just gradually light an LED using the analogWrite() function with values sent from one XBee to another. Below is my code for the coordinator:

int bright = 0;
void setup() {
  Serial.begin(9600);
  pinMode(9, OUTPUT);
}

void loop() {
  bright = bright + 3;
  if (bright > 200) {
    bright = 0;
  }
  analogWrite(9, bright);
  Serial1.flush();
  Serial1.print(bright, BYTE);

  delay(150);
}

and the code below is for the end device:

byte incomingByte, sensor;

void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
  Serial.println("Ready!");

  pinMode (2, OUTPUT);
  
  delay(1000);
}

void loop() {
  Serial.flush();
  Serial1.flush();
  
  incomingByte = Serial1.read();

  sensor = Serial1.read();
  Serial.print("LED = ");
  Serial.println(int(sensor));
  analogWrite (2, sensor);
}

In the end device I have a Serial.print() which I use to monitor the values that are being received by the XBee, but that value is always 255 (even with the serial flush). Does anyone have any suggestions?