Arduino Wire.h | Library

void setup() Serial.begin(9600); Wire.begin(); // Join I2C bus as master

Wire.requestFrom(8, 13); // Request 13 bytes from slave while(Wire.available()) Serial.print((char)Wire.read()); arduino wire.h library

Serial.println(); delay(1000);

// Request 5 bytes (3 pressure, 2 temp) Wire.requestFrom(SENSOR_ADDR, 5); void setup() Serial

Serial.println();

void requestEvent() Wire.write("Hello Master"); void setup() Serial.begin(9600)

Try the built-in I2C scanner (File → Examples → Wire → Scanner), then hook up a cheap OLED or RTC module. You’ll be amazed at what two wires can do.