Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Mon Aug 21, 2017 1:28 am |
|
|
Do it digit by digit.
You don't show us how the data is stored at the PIC end?.
However:
Code: |
int8 to_send=123;
int8 ctr;
char buffer[4];
sprintf(buffer,"%03d", to_send);
//buffer now has '123'
for (ctr=0;ctr<3;ctr++)
{
printf("%02X ",buffer[ctr]);
}
//will print "31 32 33 "
|
This takes the source integer, turns it into ASCII, 3 digits long, then outputs these three digits in hex, each with a trailing space. |
|