Using Serial_LDD To Print Integers to Serial Monitor

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using Serial_LDD To Print Integers to Serial Monitor

Jump to solution
707 Views
adegonge
Contributor II

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!

Labels (1)
0 Kudos
1 Solution
563 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
564 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
563 Views
adegonge
Contributor II

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!

0 Kudos
563 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos