Go Down

Topic: Converting float, strings and integers (Read 121 times) previous topic - next topic

willbob8

Hello,

I would like to send temperature and humidity data over an RF transmitter. The sensor provides data as a float (e.g. 45.00 %humidity and 22.00 degC) and I need to convert it into an integer for to send over the RF transmitter.
I would like to have the first 3 digits of the integer as an identification (So the receiver knows where it's coming from) and then have the next 2 digits as the humidity and the next 2 as the temperature - e.g. 0014522.

Thank you for your help

jremington

Why do you think you need to convert the data to an integer?
You can send any data format via an RF link.

PaulS

Quote
I would like to have the first 3 digits of the integer as an identification (So the receiver knows where it's coming from) and then have the next 2 digits as the humidity and the next 2 as the temperature - e.g. 0014522.
OK.

Quote
Thank you for your help
With what? You have not said what you need help with. Google sprintf() while pondering your reply.
The art of getting good answers lies in asking good questions.

Go Up