Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

Documentation for Wire.requestFrom incorrect. The function returns a value.

Open nickgammon opened this issue 13 years ago • 2 comments

The documentation for Wire.requestFrom states that the function returns "none", as documented here:

http://arduino.cc/en/Reference/WireRequestFrom

However in fact it returns the number of bytes obtained from the slave:

uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint8_t sendStop)

Please correct the web page to avoid further confusion.

nickgammon avatar Mar 18 '13 19:03 nickgammon

The page was amended to read:

Returns

int : the number of bytes returned from the slave device

However it returns an unsigned 8-bit integer, that is, uint8_t (usually called the "byte" type).

nickgammon avatar Apr 01 '13 21:04 nickgammon

Thank for the clarification, I was running and gunning when I updated that page.

shfitz avatar Apr 02 '13 04:04 shfitz