User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
637
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.
WordToHex
Prototype
void WordToHex(unsigned input, char *output);
Description Converts input number to a string containing the number’s hexadecimal representation. The output
string has xed width of 5 characters including null character at the end (string termination).
Parameters - input: unsigned integer to be converted
- output: destination string
Returns Nothing.
Requires Destination string should be at least 5 characters in length.
Example
unsigned t = 1111;
char txt[5];
...
WordToHex(t, txt); // txt is “0457”
Notes None.