InterruptIn

Fork of InterruptIn_HelloWorld by mbed_example

main.cpp

Committer:
ctasdemir
Date:
2018-05-11
Revision:
5:89938cffed21
Parent:
3:f729f0421740

File content as of revision 5:89938cffed21:

#include "mbed.h"
 
InterruptIn button(USER_BUTTON); // pull-up
DigitalOut led(LED2);
DigitalOut flash(PA_7); // PA_7 --> D11 pin
 
void flip() {
    led = !led;
}
 
int main() {
    button.fall(&flip);  
    while(1) {           
        flash = !flash;
        wait(0.25);
    }
}