If you mean convert from a decimal base10 number to a base 16 number
then a search of this board or the web should get you an answer.
If it is an output issue take a look at the printf format options.
Inside the PIC numbers are in binary base 2 representation.
To try it yourself
Take the most significant nibble (4 bits) and convert it to an 8 bit binary representation of the character you want to see ( "1"..."9","A".."F". then the least significant nibble and convert it likewise.
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
Re: How to convert DD number to 0xDD?
Posted: Sun Sep 10, 2006 5:35 pm
40inD wrote:
How to convert DD number to 0xDD?
If you want to convert a number DD to a string "0xDD", you can use sprintf(). Please treat the following code with some sarcasm, as I'm writing without the compiler or manual at hand; this is just to give you an idea:
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