Difference between revisions of "Interrupts()"
From Microduino Wiki
(Created page with "interrupts() *'''Description''' Restart the interrupt(it will be forbidden after using noInterrupts() command). The interrupt allows some important tasks to run in the ba...") |
|||
Line 21: | Line 21: | ||
{ | { | ||
noInterrupts(); | noInterrupts(); | ||
− | // | + | //important and time-sensitive code |
interrupts(); | interrupts(); | ||
− | // | + | //write other codes here |
} | } | ||
Latest revision as of 03:51, 12 August 2016
interrupts()
- Description
Restart the interrupt(it will be forbidden after using noInterrupts() command). The interrupt allows some important tasks to run in the background, and the state of it is enabled by default. After forbidding the interrupt, some functions may not be able to work, and the incoming information maybe ignores. The interrupt will slightly disturb the time of the code, so you can forbid the it in the key part.
- Parameter
No
- Return
No
- Example
void setup() { } void loop() { noInterrupts(); //important and time-sensitive code interrupts(); //write other codes here }