volatile boolean LEDstate = false; // This will store our LED state. // This way we don't waste cycles in our // interrupt changing the LED. void setup() { pinMode(PIN_LED1, OUTPUT); // Set our LED 1 pin as an output pinMode(PIN_INT2, INPUT_PULLUP); // Set our interrupt 1 pin as input and // pull it high attachInterrupt(2, LEDchange, FALLING); // Attach our ISR to interrupt 2 // and set it to trigger on falling // voltage } void loop() { digitalWrite(PIN_LED1, LEDstate); // While we're waiting for the interrupt to // trigger, let's set the LED to it's // current state. } // This is our Interrupt Service Routine void LEDchange() { LEDstate = !LEDstate; // If the interrupt is triggered, switch the LED state // If it's high, it goes low. If it's low, it goes high. }