Cannot convert 'String' to 'uint8_t {aka unsigned char}' in initialization Hey all I am trying to convert a string into a uint8_t with the following code:

String data = "#255101987";
String tmp1 = data.substring(1, 3);

uint8_t first  = (String)tmp1;


I am getting the error of:


  cannot convert 'String' to 'uint8_t {aka unsigned char}' in initialization


Any help would be great as I thought adding (String) in front of the varible would solve the issue but it hasn't as you can tell.
uint8_t first  = atoi (tmp1.substring(1, 3).c_str ());   


Or even:

String data = "#255101987";
uint8_t first  = atoi (data.substring(1, 3).c_str ());