XBee S2C (API=0, API=1) Why do I receive garbage values?

Hello, I’ve got my two XBee S2C and this is my configuration.

XBee S2C 802.15.4 TH (End Device)
CH - C
ID - 1234
DH -0
DL - 0
MY - 1
API - 0
Baudrate - 9600

XBee S2C 802.15.4 TH (Coordinator)
CH - C
ID - 1234
DH - 0
DL - 1
MY - 0
API - 1
Baudrate - 9600

When I transmit sensor data into the Arduino, the receiver which is my PC (Python) is receiving garbage values but when I send packets in XCTU, I receive the same value. Again, when I receive in XCTU the values I get from the data sensor in Arduino is in Hexadecimals and I don’t get why does it happen.

I used XBee Explorer to connect the XBee to the Arduino and to the PC. The connection of my XBee S2C in arduino is the Rx is in pin 12, Tx in pin 13.

This is my code for the transmitter:

#include <SoftwareSerial.h>
SoftwareSerial xbSerial(12, 13); // RX, TX
int pzt = A0;

void setup() {


void loop(void)
  int sensor = analogRead(pzt);
  xbSerial.write (sensor);
  delay (1000);

This is my code in receiver:

import serial, time, datetime, sys
from xbee import XBee

SERIALPORT = "COM7"    # the com/serial port the XBee is connected to, the pi GPIO should always be ttyAMA0
BAUDRATE = 9600      # the baud rate we talk to the xbee

ser = serial.Serial(SERIALPORT, BAUDRATE)

xbee = XBee(ser)

print ('Starting Up WaPACK system')
# Continuously read and print packets
while True:
        response = xbee.wait_read_frame()
        value = response['rf_data'].decode("utf-8", "ignore")

        print (response['rf_data'])
    except KeyboardInterrupt:


What is wrong with this?