I am using TinkerCad as Arduino UNO R3 simulator. My aim is to convert int to string but the following code prints 188 instead of 180.
void setup()
{
Serial.begin(115200);
}
void loop()
{
Serial.println(String(180));
}
Output is 188
as you can see in the screenshot from TinkerCad serial monitor above. Why is there a weird problem with String
?