Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7781173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:08:32+00:00 2026-06-01T19:08:32+00:00

I am having trouble transmitting a float across a simple 2 node Xbee Network.

  • 0

I am having trouble transmitting a float across a simple 2 node Xbee Network.

I am aware that the Xbee system transmits packages via bytes, so I can send a char, but I am having trouble sending anything more than that, and I can’t seem to find any documentation anywhere.

Here is my current (basic) code.

Sender:

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

Receiver:

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

Any hint as to get the float to be transmitted successfully would be great? Or if it is already being transmitted properly, how to read it properly?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:08:34+00:00Added an answer on June 1, 2026 at 7:08 pm

    You can send the float in bytes and reconstruct the float at the receiver.

    The following example may help you:

    Sender side:

    float x = 1128.476;
    
    char b[sizeof(x)];
    memcpy(b, &x, sizeof(x));
    
    // Iterate over b and send bytes
    // [...]
    

    Receiver side:

    float y = 0;
    
    char b[sizeof(x)];
    
    // Store 4 bytes representing the float into b
    // [...]
    
    // Rebuild the float
    memcpy(&y, b, sizeof(y));
    

    At the end, you have float y on the receiver side, which has the same representation of float x on the sender side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble understanding character encoding in node.js. I'm transmitting data and for some
Having trouble with proper regex for RewriteCond RewriteCond %{REQUEST_URI} !^/foo/ Works as expected, that
Having trouble with this..I'm sure I'm missing something simple but I simply want the
I having trouble with a simple question : How to have some disabled field
Having trouble linking the Stomp.framework into an iPhone SDK application. http://code.google.com/p/stompframework/ I follow the
Having trouble with the following segment of code. I'm getting a parameter count mismatch.
Having Trouble with Entity Framework. I have been populating EntityReferences with an EntityKey inorder
Having trouble finding an explanation in the docs, would someone be kind enough to
Having trouble with recursive methods in c#. When compiled it should just display the
Having trouble with a mysql grant statement. I want a user who has: readonly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.