Converting uint8_t to String - unexpected result I'm working on a remote control code for ESP controller. Using ESPwebserver and Fastled. When I try to return a value of an uint8_t, as a POST response, i got strange result here is the relevant code:

uint8_t PaletteBrightness = 255; 

server.on("/Sync", HTTP_POST, []() {
String Sync = "PaletteBrightness:" + PaletteBrightness;
    Sync += ":end";
    Serial.println(Sync);
    server.send(200, "text/plain", Sync);
  });


The code complies, and runs fine but the result of 'Sync' in both serial, and POST response is:

Phase:end


Why? What does even Phase mean?
What I want is: 

PaletteBrightness:255:end


Where the 255 is the value of 'uint8_t PaletteBrightness' Also, there will be more values, to add the 'Sync' string. Just trying to get one right.
You should convert your number uint8_t into it's ASCII representation before appending it to your string, otherwise you are appending just one character using it's byte representation.

To do so you can use a standard function itoa() which has a decent documentation available here.

So change line

 String Sync = "PaletteBrightness:" + PaletteBrightness;


into

 char buffer [4];
 String Sync = "PaletteBrightness:" + itoa(PaletteBrightness, buffer, 10);