#include #include "TinyWireS.h" const byte SLAVE_ADDR = 100; const byte LEDPIN = 3; //PB3 on the ATtiny85 equates to "3" in Arduino terms const byte BUTTONPIN = 4; //PB4 on the ATtiny85 equates to "4" in Arduino terms volatile boolean triggered = 0; void setup() { TinyWireS.begin(SLAVE_ADDR); TinyWireS.onRequest(requestISR); pinMode(BUTTONPIN, INPUT_PULLUP); } void loop() { if(triggered == 0){ if(digitalRead(BUTTONPIN) == LOW){ triggered = 1; digitalWrite(LEDPIN, triggered); } } //check whether connected button was pressed, if so, send a signal via I2C to master node*/ } void requestISR() { TinyWireS.write(triggered); // sends five bytes triggered = 0; digitalWrite(LEDPIN, triggered); }