- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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