#include int LED = 13; void setup() { // Define the LED pin as Output pinMode (LED, OUTPUT); // Start the I2C Bus as Slave on address 9 Wire.begin(9); // Attach a function to trigger when something is received. Wire.onReceive(receiveEvent); } void receiveEvent(int bytes) { int x = Wire.read(); // read one character from the I2C if (x == '0') { digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); } //If value received is 3 blink LED for 400 ms if (x == '3') { digitalWrite(LED, HIGH); delay(400); digitalWrite(LED, LOW); delay(400); } } void loop() { delay(100); }