This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

float to ascii

Hi, I need help to convert a floating point to ascii format. I found the command atof() that converts ascii to float, but what about the other way round? Is there any command in C51 that does this? And I want to send the result to PC without using the printf function because it uses a lot of space. How can I do this? Any code examples would help.

Parents
  • My mistake, it's the other way around :-(
    Seems like the code that converts float to string can't be separated from printf. You have to write it yourself.
    By the way, if you only need to send the float to PC, you don't have to convert it to string. You can send the four bytes in hexadecimal, the conversion can be done in the PC.
    - Mike

Reply
  • My mistake, it's the other way around :-(
    Seems like the code that converts float to string can't be separated from printf. You have to write it yourself.
    By the way, if you only need to send the float to PC, you don't have to convert it to string. You can send the four bytes in hexadecimal, the conversion can be done in the PC.
    - Mike

Children
No data