Just a test for all of the LED\'s on the mbed board, more comprehensive than Helloworld :)

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
warpedkevin
Date:
Thu Nov 11 22:24:05 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
diff -r 000000000000 -r c7ebb10735d6 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 11 22:24:05 2010 +0000
@@ -0,0 +1,74 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled3(LED3);
+DigitalOut myled4(LED4);
+int counter1;
+int counter2;
+bool ledtest = false;
+
+int main() 
+{
+   RESTART:
+   counter1 = 0;
+   counter2 = 0;
+   if (counter1 <= 10 && counter2 <= 10)
+   {
+   goto LOOPSTART;
+   }
+   
+   LOOPSTART:
+    while (ledtest == false)
+    {
+    if (counter1 <= 10)
+    {
+        myled = 1;
+        wait(0.1);
+        myled = 0;
+        wait(0.1);
+        myled2 = 1;
+        wait(0.1);
+        myled2 = 0;
+        wait(0.1);
+        myled3 = 1;
+        wait(0.1);
+        myled3 = 0;
+        wait(0.1);
+        myled4 = 1;
+        wait(0.1);
+        myled4 = 0;
+        wait(0.1);
+        counter1 ++;
+    }
+    else
+    ledtest = true;
+    }
+   
+    while (ledtest == true)
+    {
+    if (counter2 <= 10)
+    {
+        myled = 1;
+        wait(0.1);
+        myled = 0;
+        wait(0.1);
+        myled3 = 1;
+        wait(0.1);
+        myled3 = 0;
+        wait(0.1);
+        myled2 = 1;
+        wait(0.1);
+        myled2 = 0;
+        wait(0.1);
+        myled4 = 1;
+        wait(0.1);
+        myled4 = 0;
+        wait(0.1);
+        counter2 ++;
+    }
+    else
+    ledtest = false;
+    }
+   goto RESTART;
+}
diff -r 000000000000 -r c7ebb10735d6 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 11 22:24:05 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e