title: ATTiny85 Interrupts in Arduino IDE
body: <p>I have an ATTiny85 which I program using a sparkfun programmer (<a href="https://www.sparkfun.com/products/11801" rel="nofollow noreferrer">https://www.sparkfun.com/products/11801</a>) and the ATTiny Board Manager I am using is: <a href="https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json" rel="nofollow noreferrer">https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json</a></p>
  <p>Below is my code, I am having trouble getting the interrupt to work when I ground Pin 2.
  I have tested the LED does work outside of the interrupt (inside the loop). Any suggestions are welcome.</p>
  <pre><code>#include &quot;Arduino.h&quot;
  
  #define interruptPin 2
  
  const int led = 3;
  bool lastState = 0;
  
  void setup() {
    pinMode(interruptPin, INPUT_PULLUP);
    attachInterrupt(interruptPin, pulseIsr, CHANGE);
    pinMode(led, OUTPUT);
  }
  
  void loop() {
  
  }
  
  
  void pulseIsr() {
      if (!lastState) {
        digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
        lastState = 1;
      }
      else {
        digitalWrite(led, LOW);  // turn the LED off by making the voltage LOW
        lastState = 0;
      }
  }
  </code></pre>