Passing Floats Over Xbee


so, thought simple add cool wireless aspect temperature sensor project, passing floats on xbee seems bit of nightmare (for me anyway, can't find documentation anywhere?).

i have network , sending chars , numbers (0-9) can't more out of it. here code, appreciated.

sender:
code: [select]
void loop()
{
  sensorvalue = analogread(analoginpin);
  sensorvaluetemp = sensorvalue / 9.31; //lm35 measurement centigrade
  serial.print(sensorvaluetemp);
  delay(1000);
}


receiver:
code: [select]
void loop() {
  lcd.setcursor(0, 0);
    if (serial.available() > 0) {
    lcd.print(incomingbyte);
  }
  delay(1000);
}


i'm aware xbee transmits in bytes, don't know how go getting float values transmit in fashion.

thanks in advance.

chris

xbees send bytes. don't care whether bytes 1/4 of float, 1/2 of int, whole character, etc.

quote
here code

that not compile. sensorvalue, sensorvaluetemp (lousy name), lcd, , incomingbyte undefined.

the setup() function missing.

looks me making fundamental assumptions serial data transmission flat wrong.

can't tell snippets, though.


Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > Passing Floats Over Xbee


arduino

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial