Wire Library Arduino -

#include <Wire.h> int x = 42; void setup() Wire.begin(0x08); // Join bus as slave at address 0x08 Wire.onRequest(sendData); // Call function when master requests

void sendData() Wire.write(x);

#include <Wire.h> void setup() Serial.begin(9600); Wire.begin(); wire library arduino