voidsetup(){// Attach an interrupt on digital pin 2 (assuming you're using it with a button or sensor)
// attachInterrupt(digitalPinToInterrupt(2), myInterruptRoutine, RISING);
// ... other setup code ...
// Later, you can detach the interrupt when you no longer need it
detachInterrupt(digitalPinToInterrupt(2));// or detachInterrupt(2);
}voidloop(){// ... your main loop code ...
}voidmyInterruptRoutine(){// This function will be executed when the interrupt on pin 2 is triggered
// and it's still attached. After detachInterrupt(), this routine won't be called.
}