xbee s2, analog temp sensor not working

Have spent 2 frusterating days trying to connect two xbee’s. Configured remote temperature sensor with one xbee and assigned the output to pin3. When monitoring serial data via ardunio everything looks correct (circuit is good). When monitoring serial data on Coordinator xbee the values are not transmitting correctly. Have followed closely similar examples but the LSB/MSB calculation is not producing reasonable values. Here is the code:
//Serial.println(Serial.read());
if(Serial.read() == 0x7E){
//Serial.println(“here1”);
for (int i = 1; i< 19; i++) {
byte discardByte = Serial.read();

}
int analogMSB = Serial.read();
int analogLSB = Serial.read();
Serial.println(analogMSB);
Serial.println(analogLSB);
int analogReading = analogLSB + (analogMSB256);
Serial.println(analogReading);
temp = (analogReading / 1023)5;
temp = temp -.5;
temp = temp
100;
temp = temp
9/5 +32;
Serial.print(temp);
Serial.println(“degrees F”);
}
}
}
Xbee’s are set up as AT for Router, and API for coordinator per the many similar examples i was following.

Values are transmitting, just not the same value…or so it seems. Any help would be much appreciatted…
Tj

1 Like

Here is the code:

Well, some of it anyway. So, here is the answer.

You need to...

(Well, some of it anyway.)