Mmm ... il codice che gestisce la lettura con timeout richiama questa funzione privata :
// private method to read stream with timeout
int Stream::timedRead()
{
int c;
_startMillis = millis();
do {
c = read();
if (c >= 0) return c;
} while(millis() - _startMillis < _timeout);
return -1; // -1 indicates timeout
}
... quindi, ad ogni carattere che riceve, il conteggio dei millis() ricomincia.
Impostando quindi il timeout nella Serial.setTimeout() al valore UINT32_MAX (è un valore definito in <stdint.h> e rappresenta il massimo valore di un unsigend long) ... non dovresti avere alcun problema ![]()
Guglielmo