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:a5aeb2522cca
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 21 10:51:03 2016 +0000
@@ -0,0 +1,27 @@
+/****************************************************************
+/ simple program to show basic program structure 
+/
+/ the program flashes onboard LED #1 on/off and a rate of 1Hz 
+/
+*****************************************************************/
+
+
+
+
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+
+int main() {
+    while(1) {                    //repeat indefinitly 
+       uint8_t x = 0;             //set start interger value as 0
+           while(x < 5)  {        //while "x" interger value is less than 5 run rest of program
+            myled = 1;            //turn on LED 1
+            wait(1.0);            //wait 1s
+            myled = 0;            //turn LED 1 off
+            wait(1.0);            //wait 1s
+            x= x + 1;             //add 1 to "x" integer value
+        }
+        wait(5.0);                //wait 5s
+    }
+}