use the Ticker class to make a breathing led

Dependencies:   mbed

Fork of Ticker_HelloWorld by mbed official

main.cpp

Committer:
shiyilei
Date:
2014-10-21
Revision:
2:7a5c6bccf83c
Parent:
0:5014bf742e9b

File content as of revision 2:7a5c6bccf83c:

/****************************************************************
*file name : breathing led
*Creator:JacobShi
*Time:2014/10/20
* Description :use the Ticker class to make a breathing led
 *************************************************************/
#include "mbed.h"
Ticker  basetime;

DigitalOut myled(LED1);
void led_change(void)
{
    myled=!myled;
}


int main(void)
{
    basetime.attach(&led_change,1);
    while(1)
    {

    }
}