How does Serial.readString() manage the serial buffer?

readString does not terminate unless you tell it to wait by

myPort.bufferUntil(lf);

if you call it from draw it will give you that part what is available now

if you call it inside event
it might actually read bytes when they come in,
so there is the buffering recommended when strings are wanted.

also that depends on the system , used baud rate… v.s. sketch speed…

why you not show a screen shot what is the incoming
like from arduino IDE monitor ( terminal )
and tell more what you want to do.

1 Like