10 digit random number generator work with uin8_t

No, that is not all the code you are using. That won't even compile. Please read the "How to use this forum" post, and follow the directions.

I have taken out the random() function