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
Fork of Ticker_3 by
main.cpp
- Committer:
- ajy912
- Date:
- 2017-10-13
- Revision:
- 1:3b84da6d133f
- Parent:
- 0:0ba4641adab9
- Child:
- 2:e94dce9a7464
File content as of revision 1:3b84da6d133f:
// Blink until timeout.
#include "mbed.h"
Timeout timeout;
DigitalOut led(D13);
int secFlag = 1;
int secTic=0;
void attimeout() {
secFlag=1;
}
int main() {
while(1) {
if(secFlag) //1s
{
secFlag=0;
timeout.attach(&attimeout, 1);
secTic++;
}
if(secTic==1)
{ led =0;
wait(0.5);
led =1;
wait(0.5);
}
if(secTic==10)
{ led =0;
wait(0.5);
led =1;
wait(0.5);
}
}
}
