Interrupt code example for FRDM-KL25Z

Dependencies:   mbed

main.cpp

Committer:
APanecatl
Date:
2014-06-04
Revision:
0:e1052d370745

File content as of revision 0:e1052d370745:

#include "mbed.h"


DigitalOut RED(LED1);
DigitalOut BLUE(LED2);
InterruptIn Interrupt(PTD1);


void blink()
{
    RED=1;
    BLUE=0;
    wait(.4);
    BLUE=1;
    wait(.4);
}

int main() 
{
    Interrupt.fall(&blink);
    
    BLUE=1;
    while (1) 
    {
        RED=0;
    }
       
}