arduino / reference-en

Editable source for the Arduino Reference
https://www.arduino.cc/reference/en/
Other
163 stars 728 forks source link

[Documentation] Wire read return type #897

Open CombiesGit opened 4 years ago

CombiesGit commented 4 years ago

Docu: Wire::read()

Returns The next byte received

It should be:

Returns The next byte received (or -1 if no data is available). Data type: int.

carlosperate commented 1 year ago

Is that always meant to be the case? In the Mbed core it looks like it returns 0: https://github.com/arduino/ArduinoCore-mbed/blob/949c70ce6ae7d2910e5768d6d88fc3ae0e943584/libraries/Wire/Wire.cpp#L123

Edit: It is meant to be -1, the Mbed core will be updated.