![]() |
RUI3 (RAK Unified Interface 3) - RAK4631
|
Functions | |
void | interrupts (void) |
void | noInterrupts (void) |
void | attachInterrupt (uint32_t pin, void(*userFunc)(void), int mode) |
void | detachInterrupt (uint32_t pin) |
void | yield (void) |
void interrupts | ( | void | ) |
void setup() { } void loop() { noInterrupts(); // critical, time-sensitive code here interrupts(); // other code here }
void noInterrupts | ( | void | ) |
void setup() { } void loop() { noInterrupts(); // critical, time-sensitive code here interrupts(); // other code here }
void attachInterrupt | ( | uint32_t | pin, |
void(*)(void) | userFunc, | ||
int | mode | ||
) |
pin | the number of the interrupt |
ISR | the ISR to call when the interrupt occurs; this function must take no parameters and return nothing. This function is sometimes referred to as an interrupt service routine |
mode | defines when the interrupt should be triggered(LOW,CHANGE,RISING,FALLING) |
uint8_t ledPin = 36; uint8_t interruptPin = 13; volatile byte state = LOW; long startTime = 0; void blink() { state = !state; } void setup() { pinMode(ledPin, OUTPUT); pinMode(interruptPin, INPUT_PULLUP); attachInterrupt(interruptPin, blink, CHANGE); startTime = millis(); } void loop() { //After 20sec will disable ISR for pin13 if(millis() - startTime >= 20*1000) detachInterrupt(13); digitalWrite(ledPin, state); }
void detachInterrupt | ( | uint32_t | pin | ) |
pin | the number of the interrupt to disable |
uint8_t ledPin = 36; uint8_t interruptPin = 13; volatile byte state = LOW; long startTime = 0; void blink() { state = !state; } void setup() { pinMode(ledPin, OUTPUT); pinMode(interruptPin, INPUT_PULLUP); attachInterrupt(interruptPin, blink, CHANGE); startTime = millis(); } void loop() { //After 20sec will disable ISR for pin13 if(millis() - startTime >= 20*1000) detachInterrupt(13); digitalWrite(ledPin, state); }
void yield | ( | void | ) |