// ************************************************************ // ATtiny_attachInterrupt.ino // ************************************************************ // Ce programme est inspire de l exemple donne en page reference // pour attachInterrupt() en mettant 0 (INT0) a la place de // digitalPinToInterrupt(pin) qui n est pas accepte pour ATtiny const byte ledPin = 0; const byte interruptPin = 2; volatile byte state = LOW; void setup() { pinMode(ledPin, OUTPUT); pinMode(interruptPin, INPUT_PULLUP); attachInterrupt(0, blink, FALLING); } void loop() { digitalWrite(ledPin, state); } void blink() { state = !state; }