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.
Revision 0:4e5540dd971c, committed 2012-06-13
- Comitter:
- paulo
- Date:
- Wed Jun 13 20:02:28 2012 +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 Jun 13 20:02:28 2012 +0000
@@ -0,0 +1,25 @@
+//A simple test program to makes LEDs cycle left to right and then right to left.
+
+#include "mbed.h"
+
+PwmOut ledarray[4] = { LED1, LED2, LED3, LED4 };
+
+int main() {
+    bool forward = true;
+    int position = 0;
+    
+    while (1) {
+        if (position == 0) forward = true;
+        else if (position == 3) forward = false;
+        
+        if (forward) position++;
+        else position--;
+        
+        for (int i=0;i<4;i++) {
+            if (i==position) ledarray[i] = 1.0;
+            else if ((i==position-1) || (i==position+1)) ledarray[i] = 0.2;
+            else ledarray[i] = 0.0;
+        }
+        wait(0.2);
+    }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Jun 13 20:02:28 2012 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/737756e0b479