SD (File Operations)
This library is for using an interrupt operation from specified pins.
- Specifies a function to call when an external interrupt occurs. Replaces any previous function that was attached to the interrupt. The board has two external interrupts: number0 (on digital pin2), 1 (on digital pin3). The function to call has no parameter and no return.
- attachInterrupt(unsigned char interrupt, void(*)(void) func, int mode)
- interrupt: Specify interrupt number 0 or 1(int)
function: Specify the function to call when an interrupt occurs; this function must take no parameters and return nothing. This function is sometimes referred to as an interrupt service routine.
mode: CHANGE (whenever the pin changes value), FALLING (when the pin goes from high to low), RISING (when the pin goes from low to high)
- LOW cannot be specified to mode. In the case of specifying LOW, CHANGE is specified.
The functions used by the system are not executed during interrupt operating so delay(), millis(), Serial() do not work well.
- Turns off the given interrupt.
- detachInterrupt(unsigned char interrupt)
- interrupt: The number of the interrupt to disable.(0 or 1)
- Re-enables interrupts (after they've been disabled by noInterrupts()).
- Disables interrupts (you can re-enable them with interrupts()). Interrupts allow certain important tasks to happen in the background and are enabled by default. Some functions will not work while interrupts are disabled, and incoming communication may be ignored. Interrupts can slightly disrupt the timing of code, however, and may be disabled for particularly critical sections of code.