CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Changing data type from float to ascii

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Nora



Joined: 23 Mar 2008
Posts: 50

View user's profile Send private message

Changing data type from float to ascii
PostPosted: Tue Feb 10, 2009 5:51 am     Reply with quote

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
Code:
printf("U");

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

View user's profile Send private message

PostPosted: Tue Feb 10, 2009 8:13 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Feb 10, 2009 1:39 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group