hi all
i need to convert 16bit int to ascii text so that it can be written to an sd card fat16 system file.
can you suggest an easy way to do this
thanks
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
Posted: Tue May 23, 2006 3:22 am
perhaps:
Code:
int iValue;
char byte1;
char byte2;
byte1 = make8(iValue,0);
byte2 = make8(iValue,1);
the way you see the byte on the PC, depends on your setting.
decimal = hex = ascii.
teekaytk
Joined: 14 Jan 2005 Posts: 28
Posted: Tue May 23, 2006 3:29 am
sorry, i think i put the question in the wrong way
for example i have hex 0xFFFF
i want to write 65535 in a file for this where each letter is in ascii
so 6 is ascii 6 and 5 is ascii 5 and 3 is ascii 3.
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
Posted: Tue May 23, 2006 6:22 am
ITOA or sprintf. This question was just asked no more than a week ago.
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