Think this would be a lot cleaner if you stay on uint8_t. Now we get a uint8_t, handle it as char, then print it again as uint8_t.