Arduino File.peek()

Description

The File.peek() function reads a byte from the file without removing it from buffer. Therefore, successive calls to peek() will return the same value. The File.peek() function inherits from the Stream utility class.

The File.peek() function inherits from the Stream utility class.

Syntax

file.peek()

Parameters

  • file: an instance of the File class that is returned by SD.open()

Returns

  • The next byte (or character), or -1 if none is available.

Example Code

//TO BE UPDATED

ARDUINO BUY RECOMMENDATION

Arduino UNO R3
Arduino Starter Kit
Disclosure: Some links in this section are Amazon affiliate links. If you make a purchase through these links, we may earn a commission at no extra cost to you.
Additionally, some links direct to products from our own brand, DIYables .

※ OUR MESSAGES