mX mbed BaseBoard Ext. Int.

Dependencies:   mbed

main.cpp

Committer:
ashwin_athani
Date:
2010-12-08
Revision:
0:09eedb45b600

File content as of revision 0:09eedb45b600:

#include "mbed.h"

InterruptIn button(p11);
DigitalOut led(LED1);
DigitalOut flash(LED4);

void flip() {
    led = !led;
}

int main() {
    button.rise(&flip);  // attach the address of the flip function to the rising edge
    while(1) {           // wait around, interrupts will interrupt this!
        flash = !flash;
        wait(0.25);
    }
}