Serial.readString()
Descripción
Serial.readString() lee los caracteres del buffer serie en una cadena. La función se anula si el tiempo de espera se ha alcanzado (ver setTimeout()).
Esta función es parte de la clase Stream, y es llamada por cualquier clase que herede de ella (Wire, Serial, etc.). Ver la página principal de la claseStream para obtener más información.
Sintaxis
Serial.readString()
Parámetros
- Ninguno
Retornos
- Una cadena leÃda del buffer serie.
Ejemplo
- Type "HELLO" on Serial Monitor and click Send button:
- The result on Serial Monitor:
※ Nota:
- Serial.readString() may read a single incoming string in multiple times (resulting in multiple fragments). To read a single string at one time, use Serial.readStringUntil() with delimiter instead.
- Serial functions are not only used for the communication between an Arduino board and Serial Monitor of Arduino IDE but also used for the communication between:
- An Arduino board and other Arduino board
- An Arduino board and other sensors/devices
- An Arduino board and computer (any Serial software on computer)
Ver También
- Lenguaje: Arduino - Serial
- Lenguaje: Serial.available()
- Lenguaje: Serial.availableForWrite()
- Lenguaje: Serial.begin()
- Lenguaje: Serial.end()
- Lenguaje: Serial.find()
- Lenguaje: Serial.findUntil()
- Lenguaje: Serial.flush()
- Lenguaje: if(Serial)
- Lenguaje: Serial.parseFloat()
- Lenguaje: Serial.parseInt()
- Lenguaje: Serial.peek()
- Lenguaje: Serial.print()
- Lenguaje: Serial.println()
- Lenguaje: Serial.read()
- Lenguaje: Serial.readBytes()
- Lenguaje: Serial.readBytesUntil()
- Lenguaje: Serial.readStringUntil()
- Lenguaje: serialEvent()
- Lenguaje: Serial.setTimeout()
- Lenguaje: Serial.write()
※ ARDUINO BUY RECOMMENDATION
Arduino UNO R3 | |
Arduino Starter Kit |