|
|||||||||||
|
Technical Support Support Resources
Product Information |
C51: Transmitting Floating-Point NumbersInformation in this article applies to:
QUESTIONHow can I send and receive floating-point numbers via the on-chip UART? I have tried using a printf/scanf combination, but I cannot get it to work. ANSWERA floating-point number is stored in memory using four bytes. A good way to transmit the number is to simply send those four bytes, using a pointer to access the bytes. Here is an example:
where the function transmit() is your custom function that transmits an unsigned char using the on-chip UART or whatever method/peripheral you choose. To receive the floating-point number simply reverse the process, again using a pointer. MORE INFORMATION
SEE ALSO
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
|||||||||||
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.