If you really want a string. Try using Serial.readString(). It will return the full string.
The code could look like this:
if(Serial.available() > 0)
{
String message = Serial.readString();
Serial.println(message);
}
If you really want a string. Try using Serial.readString(). It will return the full string.
The code could look like this:
if(Serial.available() > 0)
{
String message = Serial.readString();
Serial.println(message);
}