I have a char*
of user input hex digits that I want to convert to actual hex (u8_t
type) to be able to be used in an i2c command.
Example:
Input: char* = 55
and I want to be able to use this as 0x55
in my i2c command so it has to be in hex format (My command looks like i2c_write(u8_t addr, blah, blah)
so I would use it like i2c_write(0x55, blah, blah)
. Does anyone know how to change it? I've looked at resources online and I can only find how to convert it to an int
.