Osama Sattar / Mbed 2 deprecated ME21001_Lab02_exercise_02

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
oosattar
Date:
Wed Sep 21 10:51:03 2016 +0000
Commit message:
2

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /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
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 21 10:51:03 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85
\ No newline at end of file