Syntax
uint8_t requestFrom(
    uint8_t address, 
    uint8_t quantity
);
ContentsIndex
PreviousUpNext
TwoWire::requestFrom Method (uint8_t, uint8_t)
TwoWire Class | Example
Syntax
uint8_t requestFrom(
    uint8_t address, 
    uint8_t quantity
);
Description

Enables a master to request data from a slave and get data by using available() and read()functions.

Parameters
Parameters 
Description 
uint8_t address 
[IN]The address:7-bit slave address. 
uint8_t quantity 
[IN]The quantity:number of bytes requested. 
Returns

Number of bytes returned from a slave.

Example
#include <Wire.h>
void setup()
{
    Wire.begin();
}
void loop()
{
    Wire.requestFrom(0x27,6);
    while((Wire.available()))
    {
        int c = Wire.read();
    }
}
File

Wire.h

Class