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:
if(Serial.read() == 0x7E){
for (int i = 1; i< 19; i++) {
byte discardByte = Serial.read();

int analogMSB = Serial.read();
int analogLSB = Serial.read();
int analogReading = analogLSB + (analogMSB256);
temp = (analogReading / 1023)5;
temp = temp -.5;
temp = temp
temp = temp
9/5 +32;
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…

1 Like

Here is the code:

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

You need to...

(Well, some of it anyway.)