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.
Diff: main.cpp
- Revision:
- 0:f9a53979b663
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Oct 18 03:02:41 2014 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+
+DigitalOut myled(PA_5);
+void delay(long int i);
+int main()
+ {
+ int ledx ,cycle=4000;
+ while(1)
+ {
+
+ for(ledx=0;ledx<cycle;ledx++)
+ {
+ myled = 1; // LED is ON
+ delay(ledx);
+ myled = 0; // LED is ON
+ delay(cycle-ledx);
+ }
+
+ for(ledx=cycle;ledx>0;ledx--)
+ {
+ myled = 1; // LED is ON
+ delay(ledx);
+ myled = 0; // LED is ON
+ delay(cycle-ledx);
+ }
+ }
+
+}
+void delay(long int i)
+{
+ while(i--);
+}
+