First Thanks PaulS!!
I think xbee problem is solved
Now i think my program is the problem
While i add the following code at the end of original program
void setup()
{
Serial.begin(9600);
}
void loop()
{
while (Serial.available() > 0)
{
char serialByte = Serial.read();
Serial.print(serialByte);
}
}
the arduino's serial monitor is show the "Temp" which i wanted
but the XCTU side is still nothing,
but i input something in serial monitor,
the XCTU side can show that i input from serial monitor
Also i simplified the program
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup(void)
{
// start serial port
Serial.begin(9600);
sensors.begin();
}
void loop(void)
{
sensors.requestTemperatures();
int temp = sensors.getTempCByIndex(0);
serial.print(temp);
delay(1000);
while (Serial.available() > 0)
{
char serialByte = Serial.read();
Serial.print(serialByte);
}
}
but how to let the Arduino Xbee's side get the data from the program which connected by Xbee Shield?
Any help will be appreciated.