Akari, it is more like 8.225 than just 8.
Reason being:
255 = 31x
This is because the maximum number for the system is 255 for 8 bits, and 31 for 5 bits. 31 times 8 is only 248.
This would cause greyness. To fix it, you will need to either multiply it by 8.225, or make a table. If you are using the table:
I posted code earlier but it didn't work. I'll post it again if I get it.
[edit]Here is a table for you:
unsigned char conv5to8[32] = {0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148,
156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255};