Reference.SoftwareSerialPeek History

Hide minor edits - Show changes to output

May 25, 2012, at 03:48 PM by Tom Igoe -
Changed lines 1-2 from:
!!SoftwareSerial: int peek()
!!SoftwareSerial: peek
Changed lines 20-21 from:
SoftwareSerial mySerial(6, 7);
SoftwareSerial mySerial(10,11);
February 19, 2012, at 01:21 AM by David A. Mellis -
Added lines 1-39:
!!SoftwareSerial: int peek()


Return a character that was received on the RX pin of the software serial port. Unlike [[SoftwareSerialRead | read()]], however, subsequent calls to this function will return the same character.

Note that only one SoftwareSerial instance can receive incoming data at a time (select which one with the [[SoftwareSerialListen | listen()]] function).




the character read, or -1 if none is available


(:source lang=arduino tabwidth=4:)
SoftwareSerial mySerial(6, 7);

void setup()

void loop()
char c = mySerial.peek();

!!!!See also

* [[SoftwareSerialConstructor | SoftwareSerial]]()
* [[SoftwareSerialBegin | begin]]()
* [[SoftwareSerialPrint | print]]()
* [[SoftwareSerialPrintln | println]]()
* [[SoftwareSerialRead | read]]()