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:
- loicb2000
- Date:
- 2019-10-08
- Revision:
- 0:580af977fe72
File content as of revision 0:580af977fe72:
#include "mbed.h"
DigitalOut myled(LED1); // use onboard LED #1
int main() {
int mycounter;
int flashtimes;
while(1) { // repeat the program indefinitely
for(flashtimes=0;flashtimes<5;flashtimes++) { // repeat five times
for(mycounter=0;mycounter<=flashtimes;mycounter++) { // repeat 'flashtimes' number
myled = 1; // turn on LED #1
wait(0.250); // 250ms 'on' time
myled = 0; // turn off LED #1
wait(0.250); // 250ms 'off' time
}
wait(1.000); // 1s pause
}
for(flashtimes=5;flashtimes>0;flashtimes--) { // repeat five times
for(mycounter=0;mycounter<flashtimes;mycounter++) { // repeat 'flashtimes' number
myled = 1; // turn on LED #1
wait(0.250); // 250ms 'on' time
myled = 0; // turn off LED #1
wait(0.250); // 250ms 'off' time
}
wait(1.000); // 1s pause
}
}
}