Interrupts()

From Microduino Wiki
Revision as of 03:49, 12 August 2016 by Fengfeng (talk) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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();
  //重要、时间敏感的代码
  interrupts();
  //其他代码写在这里
}

[Return to Arduino Syntax Manual]