Files at this revision

API Documentation at this revision

Comitter:
ace1
Date:
Wed Jan 13 04:36:26 2010 +0000
Commit message:

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 Jan 13 04:36:26 2010 +0000
@@ -0,0 +1,63 @@
+#include "mbed.h"
+
+int test;    //variable used in for loop to increment and decrement
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+
+int main() {
+    while (test < 5) {
+
+        if (test == 0) {
+            led1 = 1;
+            wait(0.1);
+            led1 = 0;
+            wait(0.1);
+        };
+
+        if (test ==1)  {
+            led2 = 1;
+            wait(0.1);
+            led2 = 0;
+            wait(0.1);
+        };
+
+        if (test ==2) {
+            led3 = 1;
+            wait(0.1);
+            led3 = 0;
+            wait(0.1);
+        };
+
+        if (test ==3) {
+            led4 = 1;
+            wait(0.1);
+            led4 = 0;
+            wait(0.1);
+        }
+
+        test++;
+
+        if (test == 4) {
+            test--;
+            led3 = 1;
+            wait(0.1);
+            led3 = 0;
+            wait(0.1);
+            
+            test--;
+            led2 = 1;
+            wait(0.1);
+            led2 = 0;
+            wait(0.1);
+            
+            test--;
+            led1 = 1;
+            wait(0.1);
+            led1 = 0;
+            wait(0.1);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jan 13 04:36:26 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0