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
Diff: main.cpp
- Revision:
- 0:580af977fe72
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Oct 08 16:42:37 2019 +0000
@@ -0,0 +1,34 @@
+
+#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
+ }
+ }
+}
+
+