Hi,

To convert a decimal number under 256 to a two-digit hex number,
divide the number by 16. Write the number of times 16 goes into
the number as the left digit of the hex number (using hex notation).
Write the remainder of the division as the right digit (using hex notation).

For example, try the number 171. Sixteen goes into 171 ten times with a
remainder of 11.

10 is represented by A, and 11 is represented by B in hex notation.

171 = AB

Use the PicBasic LOOKUP statement to return the left and right digit of the hex number.

LOOKUP B0,[“0123456789ABCDEF”],B1

* * *

See PicBasic Pro manual:

4.17.2. Division
(The '//' operator returns the remainder).

5.43. LOOKUP

Best regards,

Luciano