| class InterruptIn : public Base |
A digital interrupt input, used to call a function on a rising or falling edge
Example
// Flash an LED while waiting for events
#include "mbed.h"
InterruptIn event(p16);
DigitalOut led(LED1);
void trigger() {
printf("triggered!\n");
}
int main() {
event.rise(&trigger);
while(1) {
led = !led;
wait(0.25);
}
}
| InterruptIn | A digital interrupt input, used to call a function on a rising or falling edge |
| Functions | |
| InterruptIn | Create an InterruptIn connected to the specified pin |
| rise | Attach a function to call when a rising edge occurs on the input |
| rise | Attach a member function to call when a rising edge occurs on the input |
| fall | Attach a function to call when a falling edge occurs on the input |
| fall | Attach a member function to call when a falling edge occurs on the input |
| mode | Set the input pin mode |