Description

read() reads a byte from the stream and advances to the next one. This is the main difference from peek(), which reads the byte but does not advance.

This function is part of the Stream class, and can be called by any class that inherits from it (Wire, Serial, etc). See the Stream class main page for more information.

Syntax

stream.read()

Parameters

None.

Returns

The next byte (or character), or -1 if none is available. Data type: int.