#include #define pinr 4 byte data[1]; void setup() { pinMode(pinr,INPUT); Wire.begin(60); //Start communication with the i2c bus at address 60 Wire.onRequest(requestEvent);//Request event that is executed when master needs } void loop() { data[0]=!digitalRead(pinr); //Assign digital input to data[0] delay(100); //Delay of 100 ms } void requestEvent() { Wire.write(data, 1); //Send the the data value to master }