Passing Floats Over Xbee

So, thought it would be simple to add a cool wireless aspect to my temperature sensor project, but passing floats over Xbee seems to be a bit of a nightmare (for me anyway, can't find documentation anywhere?).

I have the network up and sending chars and numbers (0-9) but can't get much more out of it. Here is my code, any help would be greatly appreciated.

Sender:

void loop()
{
  sensorValue = analogRead(analogInPin);
  sensorValueTemp = sensorValue / 9.31; //LM35 measurement into Centigrade
  Serial.print(sensorValueTemp);
  delay(1000);
}

Receiver:

void loop() { 
  lcd.setCursor(0, 0);
    if (Serial.available() > 0) {
    lcd.print(incomingByte);
  }
  delay(1000);
}

I'm aware that the Xbee transmits in bytes, but really don't know how to go about getting float values to transmit in this fashion.

Thanks in advance.

Chris

XBees send bytes. They don't care whether the bytes are 1/4 of a float, 1/2 of an int, a whole character, etc.

Here is my code

That could would not even compile. sensorValue, sensorValueTemp (lousy name), lcd, and incomingByte are undefined.

The setup() function is missing.

Looks to me like you are making some fundamental assumptions about serial data transmission that are flat wrong.

Can't tell from snippets, though.

All of the setup has been done, the values defined and all of that is taken care of, I just didn't want to post extra code that was unnessecary.

What are the fundamental assumptions I am making? I know it transmits in bytes, I have the system working using chars, I would just like to know what changes I need to make to transmit a float.

Thanks

Chris

This and similar questions come up every other week here.
Some searches might clue you up.
Ignore the fact that specific radio devices are involved and concentrate on the serial aspects.

I have the system working using chars, I would just like to know what changes I need to make to transmit a float.

On the sender you have this:

  Serial.print(sensorValueTemp);

If sensorValueTemp is a float, it will be converted to a string, with two decimal places, and sent.

Then, on the receiver, you have this:

    if (Serial.available() > 0) {
    lcd.print(incomingByte);

If all you are doing with the incoming data is showing it on the LCD, then no changes are required.