Need Interrupt to Only Fire Once

Another interesting thing happens if I remove the volatile on the boolean armed. Now it outputs false when the interrupt is NOT triggered and stops outputting with the interrupt is triggered. Almost the exact opposite of what happens in the above code. I really don't understand it. I've been looking into it, but no such luck yet. Any suggestions are welcome :slight_smile:

int accelPin = 2; // pin for accelerometer
int laserPin = 12; // pin for laser

// variables that change:
volatile int accelState = LOW;
bool armed = true;

void setup() {
  // initialize the laser pin as an output:
  pinMode(laserPin, OUTPUT);
  // initialize the accelerometer pin as an input:
  pinMode(accelPin, INPUT);
  // attach an interrupt: 
  attachInterrupt(digitalPinToInterrupt(2), pin_ISR, HIGH);
  // initiate serial communication.
  Serial.begin(9600);

}

void loop() {

  Serial.print(armed);
  Serial.print("\n");

}

void pin_ISR () {
  if (armed==true)
    {  
    accelState = digitalRead(accelPin);
    digitalWrite(laserPin, accelState); // output val = input val
    armed = false;
    }
 }