#include #include #define output (PB3) #define I2C_SLAVE_ADDR (1) void setup() { // put your setup code here, to run once: TinyWireS.begin(I2C_SLAVE_ADDR); pinMode(output, OUTPUT); } volatile byte msg = 0; void loop() { if(TinyWireS.available()) msg = TinyWireS.receive(); if(msg == 1) digitalWrite(output, HIGH); else if(msg == 0) digitalWrite(output, LOW); else msg = 0; }