I assume you know of the switch statement? Basically simple hex (as in 0 - 255 I believe) is made up of 2 characters. The first is multiplied by 16, then the second is added. So if you only have two characters available, the highest number is FF which is (15x16)+15 == 255

Basically you have to have some sort of algorithm which displays a number if x<10 and letters corresponding to the number if x>10 (if you can understand that). If you want, I'll post a program that I wrote to convert decimal to hex, but you should have a try first yourself.

If you don't understand what I wrote, try searching google for a table that gives you hex and decimal beside each other and work out the relationship in order to create an algorithm. That's how I made my program.

ac