InterruptIn

Fork of InterruptIn_HelloWorld by mbed_example

Committer:
ctasdemir
Date:
Fri May 11 05:09:48 2018 +0000
Revision:
5:89938cffed21
Parent:
3:f729f0421740
InterruptIn

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 0:7a20a6aa1f5e 1 #include "mbed.h"
mbed_official 0:7a20a6aa1f5e 2
ctasdemir 5:89938cffed21 3 InterruptIn button(USER_BUTTON); // pull-up
ctasdemir 5:89938cffed21 4 DigitalOut led(LED2);
ctasdemir 5:89938cffed21 5 DigitalOut flash(PA_7); // PA_7 --> D11 pin
mbed_official 0:7a20a6aa1f5e 6
mbed_official 0:7a20a6aa1f5e 7 void flip() {
mbed_official 0:7a20a6aa1f5e 8 led = !led;
mbed_official 0:7a20a6aa1f5e 9 }
mbed_official 0:7a20a6aa1f5e 10
mbed_official 0:7a20a6aa1f5e 11 int main() {
ctasdemir 5:89938cffed21 12 button.fall(&flip);
ctasdemir 5:89938cffed21 13 while(1) {
mbed_official 0:7a20a6aa1f5e 14 flash = !flash;
mbed_official 0:7a20a6aa1f5e 15 wait(0.25);
mbed_official 0:7a20a6aa1f5e 16 }
mbed_official 0:7a20a6aa1f5e 17 }