Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp
- Committer:
- lianghaopo
- Date:
- 2016-03-01
- Revision:
- 1:f8bee01e9ab4
- Parent:
- 0:a11b0f2e51af
- Child:
- 2:889d77deda82
File content as of revision 1:f8bee01e9ab4:
#include "mbed.h"
#include "base.h"
volatile uint16_t count = 0;
DigitalOut myled(USER_LED);
Ticker timer_led;
Timeout timeDelay;
void ISR_blink(){
    count++;
}
void timer_Init(){
    timer_led.attach_us(&ISR_blink , 1000);
}
void timer_set(){
    timeDelay.attach(&timer_Init , 4.0);
}
int main() {
    
    timer_set();
    
    while(1) {
        if(count == 1000){
            myled = HIGH;
            wait(0.1);
            myled = !myled;
            count = 0;
        }
    }
}