Serial.peek()
Descripción
Devuelve el siguiente byte (carácter) de datos serie entrante sin sacarlo del buffer serie interno. Es decir, las llamadas sucesivas a peek() devolverán el mismo carácter, como lo será en la siguiente llamada a read().
Serial.peek() hereda de la clase Stream.
Sintaxis
Serial.peek()
Solo Arduino Mega:
Serial1.peek()
Serial2.peek()
Serial3.peek()
Parámetros
- Ninguno.
Retornos
- El primer byte de datos de entrada serie disponible (o -1 si no hay datos disponibles) - int
※ Nota:
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.print()
- Lenguaje: Serial.println()
- Lenguaje: Serial.read()
- Lenguaje: Serial.readBytes()
- Lenguaje: Serial.readBytesUntil()
- Lenguaje: Serial.readString()
- Lenguaje: Serial.readStringUntil()
- Lenguaje: serialEvent()
- Lenguaje: Serial.setTimeout()
- Lenguaje: Serial.write()
※ ARDUINO BUY RECOMMENDATION
Arduino UNO R3 | |
Arduino Starter Kit |