Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Detach interrupts from a source in Arduino
We have seen that in order to attach interrupts to a source, we use the .attachInterrupt() function, with the required arguments.
For example, for attaching the interrupts to a specific pin, we use
attachInterrupt(digitalPinToInterrupt(pin), ISR, mode);
In the same way, to detach the interrupt from a source, we can call the detachInterrupt() function. This will simply disable that particular interrupt. The recommended syntax for disabling pin interrupts is −
detachInterrupt(digitalPinToInterrupt(pin))
where pin is the pin number on which you wish to disable the interrupt.
Advertisements
