Hello,
What you seem to require, is to convert an arbitrary byte value (that may just happen to represent an ASCII character), into two hexadecimal ASCII characters, one for each nybble. For example -
// Convert upper nybble to hexadecimal ASCIIbyte conv2hex_H( byte val){ val >>= 4 + '0'; if (val > '9') val += 7; return val;}// Convert lower nybble to hexadecimal ASCIIbyte conv2hex_L( byte val){ val &= 0x0F + '0'; if (val > '9') val += 7; return val;}
Regards,
Mac