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 CCS Technical Support

Code to convert int variable to char

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



Joined: 03 Mar 2006
Posts: 4

View user's profile Send private message

Code to convert int variable to char
PostPosted: Fri Aug 18, 2006 11:31 am     Reply with quote

Hi,

Anybody could help me please,

I need a library to convert a integer variable to char, im sending this to a LCD.

thanks for any help, Very Happy
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Fri Aug 18, 2006 12:06 pm     Reply with quote

sprintf springs to mind or roll your own, pretty simple to take apart an integer and convert each to ASCII equivalent.

Look up the modulus operator, think about it for a while and also look closely at an ASCII code chart.

This is a general question, so if you absolutely can't figure out how to use sprintf, repost your question in the general forum.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
rhein



Joined: 03 Mar 2006
Posts: 4

View user's profile Send private message

PostPosted: Fri Aug 18, 2006 2:07 pm     Reply with quote

i will look for information about sprintf function.

thanks for help
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Aug 18, 2006 2:31 pm     Reply with quote

Use the re-direction feature of the CCS printf function to send output
to the lcd_putc() function. See this post for an example:
http://www.ccsinfo.com/forum/viewtopic.php?t=26398&start=2
rhein



Joined: 03 Mar 2006
Posts: 4

View user's profile Send private message

PostPosted: Mon Aug 21, 2006 6:44 am     Reply with quote

it works and it is pretty simple.


Thanks for help.
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