uint8_t * to integer and string
Your problem is that you are storing your text in an unsigned pointer (uint8_t *)instead of a signed pointer (char *).

If you change all your text types to char * then you can directly use atoi().  If you have a lot to change, though, you can just cast the unsigned pointer into a signed one (and make it const at the same time):

analogWrite(13, atoi((const char *)text));