#include int buttonState; void setup() { pinMode(led, OUTPUT); pinMode(button, INPUT_PULLUP); Serial.begin(115200); Wire.begin(1); //address for node1 is 1 //onRequest is responding to requestFrom function from the control Wire.onRequest(requestEvent); } void loop() { //if button on node is pressed, turn on the led and give the buttonState varible 5 if(digitalRead(button) == LOW){ digitalWrite(led, HIGH); delay(200); digitalWrite(led, LOW); buttonState = 5; } else{ buttonState = 0; } } //send data from node to the control void requestEvent(){ Wire.write(buttonState); }