User manual
mikroC PRO for dsPIC
MikroElektronika
721
ByteToHex
Prototype
void ByteToHex(char input, char *output);
Description Converts input number to a string containing the number’s hexadecimal representation. The output
string has xed width of 3 characters including null character at the end (string termination).
Parameters
- input: byte to be converted
- output: destination string
Returns Nothing.
Requires Destination string should be at least 3 characters in length.
Example
unsigned short t = 2;
char txt[3];
...
ByteToHex(t, txt); // txt is “02”
Notes None.
ShortToHex
Prototype
void ShortToHex(unsigned short input, char *output);
Description Converts input number to a string containing the number’s hexadecimal representation. The output
string has xed width of 3 characters including null character at the end (string termination).
Parameters
- input: signed short number to be converted
- output: destination string
Returns Nothing.
Requires Destination string should be at least 3 characters in length.
Example
short t = -100;
char txt[3];
...
ShortToHex(t, txt); // txt is “9C”
Notes None.