Send data integrating sketches: DS18x20 with Xbee ZB S2 Pro configured with API

hello forum friends

can someone please help me with a problem of creating a sketch with API

I have two modules: XBEE ZB S2 Pro, configured with API mode and wish to integrate DS18x20 (On Wire) and Series2_Tx (XBee) examples that come by default in Arduino. the problem is not how to post integrate sensor data and included in the package sent to Xbee, not the type of information that must pass xbee, because I get the float data type and that I send in the Xbee package not used that type. If anyone please know how to structure this like some sketch or sketch you can guide me, or maybe about this, I really appreciate it

Thanks

Perhaps if you'd posted some code, instead of all that handwaving...

Hi I tried the code without results is:

#include <OneWire.h>
#include <XBee.h>
#include <NewSoftSerial.h>

OneWire ds(8); // on pin 10 (a 4.7K resistor is necessary)

XBee xbee = XBee();

uint8_t payload = { 0, 0 };

// SH + SL Address of receiving XBee
XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0x409e2ef3);
ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
ZBTxStatusResponse txStatus = ZBTxStatusResponse();

void setup(void) {
Serial.begin(115200);
xbee.begin(115200);
}
void loop(void) {
byte i;
byte present = 0;
byte type_s;
byte data[12];
byte addr[8];
float celsius, fahrenheit;
if ( !ds.search(addr)) {
Serial.println();
ds.reset_search();
delay(2500);
return;
}
ds.reset();
ds.select(addr);
ds.write(0x44, 1); // start conversion, with parasite power on at the end
delay(1000); // maybe 750ms is enough, maybe not
present = ds.reset();
ds.select(addr);
ds.write(0xBE); // Read Scratchpad
for ( i = 0; i < 9; i++) { // we need 9 bytes
data = ds.read();

  • }*

  • int16_t raw = (data[1] << 8) | data[0];*

  • if (type_s) {*

  • raw = raw << 3; // 9 bit resolution default*

  • if (data[7] == 0x10) {*

  • raw = (raw & 0xFFF0) + 12 - data[6];*

  • }*

  • } else {*

  • byte cfg = (data[4] & 0x60);*

  • if (cfg == 0x00) raw = raw & ~7; // 9 bit resolution, 93.75 ms*

  • else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms*

  • else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms*

  • }*

  • celsius = (float)raw / 16.0;*

  • Serial.print(celsius);*

  • payload[0] = raw >> 8 & 0xff;*

  • payload[1] = raw & 0xff;*

  • xbee.send(zbTx);*
    }

Hi I tried the code without results is:

I imagine that the compiler doesn't like the smiley faces.