Skip to main content
Arduino

Return to Revisions

2 of 2
Commonmark migration

Interestingly enough, Serial.read() does not work like most of us think.

Serial.read() is not blocking, it always returns immediately with a byte 0-255 or -1 if there is no character to read.

From Arduino Reference

Description

Reads incoming serial data. read() inherits from the Stream utility class.

Syntax

Serial.read()

Parameters

None

Returns

the first byte of incoming serial data available (or -1 if no data is available) - int

Wirewrap
  • 341
  • 4
  • 9

AltStyle によって変換されたページ (->オリジナル) /