Receiving float values over virtualwire connection. convert byte array to float.

Hi Guys n gals,

i have hit a wall with my code.

my application is receiving temperature from a remote ds18b20 over a virtualwire connection and a 433mhz tx rx set.

what i have is the sending of the temp and the receiving of the buffer.

output:
temp: 74.41 = buffer
bufferlen: 6 = buffer length
temp2: 0.00 = float velocity

Here is the function that handles the rx receive bit.

 void readrx(){

      uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
 float velocity;

union u_tag {
    uint8_t b[6]; 
    float fval;
} u;
    if (vw_get_message(buf, &buflen)) // Non-blocking
    {
	int i;
	// Message with a good checksum received, print it.
	Serial.print("temp: ");
 
	for (i = 0; i < buflen; i++)
	{
	   Serial.write(buf[i]);
           u.b[i]=buf[i];
	}

Serial.println("");
Serial.print("bufferlen: ");
Serial.println(buflen);
velocity = u.fval;
Serial.println(velocity);
 }
  }//end of readrx

and at that point i am stuck.

i can provide more code if needed.

any ideas?

Raptor

i can provide more code if needed.

It is. All of it. On both ends.