Greece2001:
yep, that's the one. parseInt().But look what I found :
https://arduino-projekte.webnode.at/meine-libraries/serieller-monitor/
One can select the expected type of var (byte, Int16, float, etc.) and choose
between blocking (great! That's what I needed!) and non-blocking.
Problem solved and maybe not only for me (no need to write a lib, there is this one ...)Thanks for all your comments !
the library does nothing else then
int x = 0;
if (Serial.available())
{
x = Serial.parseInt();
}
you can use parseFloat(), readBytesUntil(), readBytes()
or
you could read a whole line into a buffer and then use sscanf or parse the buffer with strtok
IPAddress has function fromString