programacion del codigo del sensor DS18B20+Arduino

Hi all, I'm doing a project with a sensor connected to an Arduino DS18B20 one, and this in turn connected to an Xbee. I have problems in programming I hope someone can help me because I'm very need ..

this is the code I made for the transmission of the sensor to the arduino xbee missing me, but I get an error .. if anyone can tell me that gives me that error. and I thank the xbee transmission complete.

Hola a todos, estoy haciendo un proyecto de un sensor DS18B20 conectado a un Arduino uno , y este a su vez conectado a un Xbee. tengo problemas en la programación espero alguien me pueda ayudar pues estoy con mucha necesitas..

este es el código que hice para la transmisión del sensor al arduino me falta la del xbee, pero me da un error .. si alguien puede decirme por que me produce ese error. y agradezco que me completen la transmisión al xbee.

#include <OneWire.h>
#include <DallasTemperature.h>

int count =0;
float temp =0.0;
int tempsenal =2;

OneWire DS18B20(tempsenal);
DallasTemperature sensor(&DS18B20);

void setup (){
Serial.begin(19200);
sensor.begin();
}
void loop(){
sensor.requestTemperatures();
temp = sensor.getTempCByIndex(0);
Serial.print (temp);
Serial.println();
delay(1000);
}

the following code is the receiver in this'm worse I want to be transmitted via USB but not like this and gives me all possible errors if they can tell me how is the code .. or make me really appreciate some correction

el siguiente código es del receptor en este estoy peor lo quiero que se transmita por puerto usb pero no se como y este me da todos los errores posibles si pueden decirme como es el código.. o hacerme alguna corrección lo agradezco mucho

float temp =0.0;
void setup()
{
Serial.begin(19200);
}
void loop()
{
temp=Serial.read();
if (USB.available)
{
USB.send(temp);
}
}

I really need your help...

    temp=Serial.read();
    if (USB.available)
    {
      USB.send(temp);
    }

Serial.read() returns one byte, you transmitted the value in ASCII (in textual form), so you have to read several bytes and parse them.

Where do you have the USB object from? You don't include a library header but the default Arduino code does not offer such an object.

Have you tried the XBee connection itself? Without the sensor?

hi thanks for replying, not e-tested hacerlo.necesito not as a code that can receive data transmitted me the tx. the receiver is connected arduino with xbee and usb port to pc .... but I can not make the reception code .. you can do me a favor / / /

hola gracias por responder, no lo e probado por que no se como hacerlo.necesito un codigo que pueda recibir los datos que me trasmite el tx. el arduino receptor esta conectado con un xbee y un puerto usb a la pc.... pero no logro hacer el código de recepción .. puedes hacerme el favor de hacerlo///

in the first code has an error tx me can tell me why?
en el primer codigo de tx me presenta un error puedes decirme el por que ?

This looks to me like google-translated. I'm sorry but I don't understand. I don't know what "hacerlo.necesito" is and I have the impression you didn't replied to my questions. Don't you think you should ask your question in the forum in your language (I guess Spanish...)?

He is asking for the code to transmit from the Arduino to the Xbee, and also has an error reading the sensor i think.

But agreed he shouldnt be asking here

Hola!

Ya intentaste preguntar en el foro en Espanol? Tal vez ahi alguien te pueda ayudar

Aqui esta el enlace :slight_smile: http://arduino.cc/forum/index.php/board,32.0.html