- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
Enable and disable interrupts in Arduino
If you wish to disable interrupts (when executing some critical piece of code, especially one which should be completed within a given time period), you can do that with the help of the noInterrupts() function.
Once your critical code has executed and you wish to re-enable the interrupts, you can do that using interrupts() function. Note that interrupts are enabled by default in Arduino, and therefore, calling interrupts() without an initial call to noInterrupts() is unnecessary.
Example
The general structure of a code containing noInterrupts() and interrupts() is given below −
void setup() { // put your setup code here, to run once: } void loop() { // put your main code here, to run repeatedly: noInterrupts(); //Add critical code that needs to be completed in a specific time below interrupts(); //Add non-critical code, that can tolerate interruptions, below }
- Related Articles
- Interrupts in Arduino
- Timer Interrupts in Arduino
- Detach interrupts from a source in Arduino
- How to enable and disable submit button using jQuery?
- How to Disable / Enable a Button in TKinter?
- How can we ENABLE AND DISABLE a particular MySQL event?
- How to disable/ enable checkbox with jQuery?
- How can I disable/enable GPS programmatically in android?
- How to enable/disable data connection in iOS programmatically?
- How to enable/disable the GPS programmatically in Android?
- How to disable/enable an input box with jQuery?
- How to enable or disable interlace using imageinterlace() function in PHP?
- How to enable or disable the GPS programmatically on Kotlin?
- How to enable / Disable Enhanced Protection Mode in Internet Explorer using PowerShell?
- Interrupts in 8085

Advertisements