#include int motor = 3; int x = 0; void setup() { pinMode (motor, OUTPUT); Wire.begin(0x08); Wire.onReceive(receiveEvent); Serial.begin(9600); } void receiveEvent(int bytes) { x = Wire.read(); } void loop() { if (x == 1) { digitalWrite(motor, HIGH); } else { digitalWrite(motor, LOW); } }