How do I translate the data in HEX 43 48 to char in ascii c h? What function do I use?
Without seeing the program code I don't know the context in which those values arise.
In my mind 0x43 is the character 'C' and no conversion is required. And note that it is upper-case 'C'
...R
I hate to tell you this but HEX 43 is not c, it is C
A small point maybe, but when programming detail is important.
Perhaps if you told us what you want to do with the C and H more help could be provided.
Does this help ?
int hexInt = 0x43;
void setup()
{
Serial.begin(115200);
Serial.println((char) hexInt);
}
void loop()
{
}
Okay, I must save C in a variable and not its value in hexadecimal. I receive by the serial port 0x43 and I must send by another serial port C.
and if you forgive, forget to put it in uppercase ![]()
I must save C in a variable and not its value in hexadecimal.
'C' and its Hex value are the same as far as the computer is concerned. It is humans that would prefer to see 'C'
What exactly are you doing ?
I know it's the same, but I have to send the value in "human" view. I do not know if I'm explaining myself very well ...
To send the human view, see the code in reply #2 ![]()
I will try it!