Unable to send serial data to XBee connected to Arduino Uno without a shield

So here are some pictures of the setup I have with an LED, 330 Ohm resistor, Arduino UNO, 2 XBee S1s, and many wires,

Pictures of my setup

For specifics, here is the wiring,

-XBee Pin 1 (VCC) is connected to Arduino Uno Pin 3.3V
-XBee Pin 2 is connected to Arduino Uno Pin 1 (TX)
-XBee Pin 3 is connected to Arduino Uno Pin 0 (RX)
-XBee Pin GND is connected to the minus column on the breadboard.
-Arduino Uno Digital Pin 9 is connected to a 330 ohm resistor which is connected to an LED that is -connected to the minus column on the breadboard
-Arduino Uno Pin GND is connected to the minus column on the breadboard
-And lastly I have another XBee connected to my laptop through a USB dongle

I'm trying to send data in the form of bits through my computer using a program called XCTU to turn the LED on and off. Here is the code for the Arduino,

int led = 9;
int bufferSize = 100;
byte readBuffer[100];
byte lastByte = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(led, OUTPUT);
digitalWrite(led, HIGH);
}

void loop() {
// put your main code here, to run repeatedly:
int toRead = Serial.available();
if(toRead > 0){
while(toRead > bufferSize){
Serial.readBytes(readBuffer, bufferSize);
toRead = toRead - bufferSize;
}

Serial.readBytes(readBuffer, toRead);
lastByte = readBuffer[toRead - 1]; //reads last big in serial input

if(lastByte == '1'){
digitalWrite(led, HIGH);
}
else if(lastByte == '0'){
digitalWrite(led, LOW);
}
}
delay(250);
}

However, when I send a '0' through XCTU, the LED doesn't turn off. What could be causing this? Note that I did not use a shield to connect the XBee to the Arduino Uno, I soldered the pins to the appropriate spots because I thought it was possible after watching this video, https://www.youtube.com/watch?v=wtal7SWZek0

Also, I'm cross-posting this on arduino stack exchange to get as much input on this as possible. I'll keep both topics updated to attribute answerers from both sites accordingly (Unable to send serial data to XBee connected to Arduino Uno without a shield - Arduino Stack Exchange)

 if(toRead > 0){
   while(toRead > bufferSize){
     Serial.readBytes(readBuffer, bufferSize);
     toRead = toRead - bufferSize;
   }

When this is done, how many bytes are going to be in readBuffer?

   Serial.readBytes(readBuffer, toRead);

When this is done, how many bytes are going to be in readBuffer?

Why the hell do you need code so complicated when you are sending one byte?

You have failed to say anything about which XBees you have, or how they are configured.

Why are you connecting the XBee to the hardware serial pins? That prevents you from using them to debug your program.

int toRead = Serial.available();
if(toRead > 0){
  while(toRead > bufferSize){
    Serial.readBytes(readBuffer, bufferSize);
    toRead = toRead - bufferSize;
  }

  Serial.readBytes(readBuffer, toRead);

The code above is complicated because it deals with cases where the serial input is more than 100 bytes long, so if this is the case then at the end, the buffer should only hold the last 100 bytes read. If the serial input is less than 100 bytes then the buffer will have that many bytes read.

The XBees are "XBee 1mW Wire Antenna - Series 1 (802.15.4)" and they are configured in XCTU with the default settings (Baud Rate: 9600, Data Bits: 8, Stop Bits: 1, no Parity nor flow control) and the Channel plus the Pan ID are the same across both XBees.

As to why Im connecting the Xbee to the hardware serial pins, I wasn't sure how else I could connect the XBee to the Arduino Uno without a shield other than soldering the correct pins together.

The XBees are "XBee 1mW Wire Antenna - Series 1 (802.15.4)" and they are configured in XCTU with the default settings (Baud Rate: 9600, Data Bits: 8, Stop Bits: 1, no Parity nor flow control) and the Channel plus the Pan ID are the same across both XBees.

That tells me both a lot and very little. I know that you have the right kind of XBees for point-to-point communication. But, i have no idea whether you've told Joe to talk to Tom and for Elizabeth to talk to Mary, or whether you told Tom to talk to Mary and for Mary to talk to Tom.

So oddly enough, with this code everything seems to be working,

#include "SoftwareSerial.h"

SoftwareSerial XBee(1, 0); //TX is 1, RX is 0 on the Arduino Uno
int LED = 9;

void setup()
{
  // Baud rate MUST match XBee settings (as set in XCTU)
  XBee.begin(9600);
  pinMode(LED, OUTPUT);
}

void loop()
{
  if (XBee.available())  
  { 
    byte c = XBee.read();
    if (c == '1')
    {
      digitalWrite(LED, HIGH);
      
    }
    else if (c == '0')
    {
      digitalWrite(LED, LOW);
    }
  }
  delay(150);
}

I went back to check the configuration, the DH, DL, MY, and CE were set up correctly originally. I'm wondering why the SoftwareSerial class solved the problem? What was wrong with the original code?

I'm wondering why the SoftwareSerial class solved the problem?

I don't think it did. The code with SoftwareSerial looks nothing like the earlier code with Serial.

But even when I replace the following in the original,

int toRead = Serial.available();
 if(toRead > 0){
   while(toRead > bufferSize){
     Serial.readBytes(readBuffer, bufferSize);
     toRead = toRead - bufferSize;
   }

   Serial.readBytes(readBuffer, toRead);
   lastByte = readBuffer[toRead - 1]; //reads last big in serial input

with

int toRead = Serial.available();
 if(toRead > 0){
   lastByte = Serial.read();

there still seems to be no connection. In this case both pieces of code look very similar albeit the only major difference now is the use of the SoftwareSerial class.