#include void setup() { pinMode(5, OUTPUT); // Setup the built-in LED Wire.begin(0x04); // Set this device's I2C address to 0x04 Wire.onReceive(receiveEvent); Serial.begin(115200); } void loop() { delay(100); // Do nothing, just wait for I2C commands } void receiveEvent(int howMany) { while (Wire.available()) { int c = Wire.read(); // Read byte if (c == 1) { digitalWrite(5, HIGH); // Turn LED on delay(2000); // Keep it on for 1 second digitalWrite(5, LOW); // Then turn it off } } }