Well you can always make your own dec2hex converter function like I did.
void Dec2Hex(unsigned short D, char * buf, byte Size) // Size meaning, 1 = 0x00, 2 = 0x0000, 4 = 0x00000000
{
byte i = 0;
short val;
while (i != (Size * 2))
{
val = (D % 16);
buf[(Size * 2) - 1 - i] = ((val < 10) ? val + '0' : (val + 'A' - 10)) ;
D /= 16;
i++;
}
}
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
uint8_t Shorts08H[3] = {1, 1, 0};
PrintHex8(Shorts08H, 3); // returns 0x01 0x01 0x00
}
void loop() {
// put your main code here, to run repeatedly:
}
void PrintHex8(uint8_t *data, uint8_t length) // prints 8-bit data in hex with leading zeroes
{
char tmp[16];
for (int i = 0; i < length; i++) {
Dec2Hex(data[i], tmp, 1);
Serial.print(tmp);
}
}
void Dec2Hex(unsigned short D, char * buf, byte Size) // Size meaning, 1 = 0x00, 2 = 0x0000, 4 = 0x00000000
{
byte i = 0;
short val;
char Template[] = "0x00 ";
while (i != (Size * 2))
{
val = (D % 16);
Template[((Size * 2) - i) + 1] = ((val < 10) ? val + '0' : (val + 'A' - 10)) ;
D /= 16;
i++;
}
strcpy(buf, Template);
}