View previous topic :: View next topic |
Author |
Message |
Nora
Joined: 23 Mar 2008 Posts: 50
|
Changing data type from float to ascii |
Posted: Tue Feb 10, 2009 5:51 am |
|
|
hello-
Is there a command that changes the data type from float to ascii?
I am sending a float serially to a display with Code: |
printf(" PT = %3.2f",temp_f) |
which results in printing PT = 85. If I ask the display to print this in HEX, it converts correctly PT = 0055
When I look at what is being sent via Hyperteminal, I see the correct value, which is constantly changing, but common values are something like 72.56, 73.45...
I think that it is possible that this display, a 4D systems OLED, cannot interpret this. I have only been able to get the display to correctly print
I have been able to get the display to send correct characters to my PIC18F452.
Therefore, I thought if I changed data types prior to sending, I might have better results.
Thank you,
Nora |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Tue Feb 10, 2009 8:13 am |
|
|
Can you print text to this display? Beware of printing "U" as a test because that character may still print if it is inverted. Try other characters.
Printf by its nature converts its argument to an ASCII string sent out the serial port. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 10, 2009 1:39 pm |
|
|
Quote: |
I think that it is possible that this display, a 4D systems OLED, cannot
interpret this. |
Post the full OLED part number and a link to the web page for it.
Also post your PIC and your compiler version. |
|
|
|