Internal Interrupts?

I've researched a bit, and I've ran into a couple of examples of how buttons are used as interrupts. However, the design I'm trying to implement uses analog sensors. Right now, what I want to do is to have my analog sensors flag a boolean to tell the interrupt to execute, not a button. How would I do so?

This is what I have thought up based on what I researched:

boolean isWall;

attachInterrupt(isWall, interruptFunction, RISING);

void loop() {
if(analogSensor.response > 450) {
isWall = true;
}
normalExecution(); // what it normally does if isWall is false
}

void interruptFunction() {
// code implementation
isWall = false; // set isWall back to false after executing interruptFunction
}

void normalExecution() {
// foo
}
Can someone verify?

I've ran into a couple of examples of how buttons are used as interrupts.

Only in a most awkward and unnecessary manner. Interrupts are cause by external events, like serial data arriving, or by things that happen very frequently, and need to not be missed, like encoders rotating.

If a switch is connected, it should be polled in loop().

Analog devices do not trigger interrupts, because the time taken to read an analog sensor is so long, in terms of how many times loop() could loop, that polling is fast enough.

Let's get back to the real world. What is your application? Why do you need to know if an analog input changes? Is this something to do with watering plants? If so you hardly need to turn the sprinklers on with microsecond precision.

How would I do so?

Three ways:

  1. continuous adc: have a free running adc and once the result is over a threshold, raise a flag. This can be a MIPS drain;
  2. use a comparator: use the analog comparator to trigger an event.
  3. use the digital input's threshold hold: apply the input to a digital pin and it will trigger a logic '1' when the Vhi(th) minimum is reached.