Timer interrupt code example for FRDM-KL25Z

Dependencies:   mbed

main.cpp

Committer:
APanecatl
Date:
2014-06-04
Revision:
0:1345a2932f87

File content as of revision 0:1345a2932f87:

#include "mbed.h"
 
DigitalOut RED(LED1); 
DigitalOut GREEN(LED2);
Timeout timeout;

 
int on = 1;

 

 void clear() 
{
    on=0;
    GREEN=0;
    wait(.4);
    GREEN=1;
    
}


int main() 
{
    timeout.attach(&clear,5);
 
    GREEN=1;   
    while(on)
    {
        RED= !RED;
        wait(0.3);
    }
    
}