Hey Everyone,
I'm trying to use the Serial_LDD block in order to output some values to a serial monitor. I can get this function working just fine with characters and arrays of characters, but I can't get it to print integers unless I declare the value as a character (Like char n = '1';). I would like to be able to print any integer to the serial monitor, whether this be direct or by converting it into a character like I manually did above. Any help would be appreciated!
Solved! Go to Solution.
hi Andew,
i think the problem is your PC side serial terminal doesn't enable hex display. some serial terminal doesn't have feature of displaying hex character. please choose a serial terminal monitor that can display hex
otherwise you have to modify your C code, convert your integer to a string. then display the member of string one by one via Serial_LDD to serial terminal. for this topic your can use google search - how to convert ascii to string.
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
hi Andew,
i think the problem is your PC side serial terminal doesn't enable hex display. some serial terminal doesn't have feature of displaying hex character. please choose a serial terminal monitor that can display hex
otherwise you have to modify your C code, convert your integer to a string. then display the member of string one by one via Serial_LDD to serial terminal. for this topic your can use google search - how to convert ascii to string.
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Perfect thanks! I was using putty and that turned out to be the restricting factor, I downloaded RealTerm and I can now display numbers directly without having to convert to a string. Thanks!
you are welcome! thank you for using Freescale Community!
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------