Leds variable flash

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jaume
Date:
Thu Oct 28 17:26:36 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	Thu Oct 28 17:26:36 2010 +0000
@@ -0,0 +1,22 @@
+// Parpadeo.- JaumeB
+#include "mbed.h"
+DigitalOut mbled0(LED1);
+DigitalOut mbled1(LED2);
+DigitalOut mbled2(LED3);
+DigitalOut mbled3(LED4);
+int main() {
+    int interval = 30;
+    while(1) {
+        mbled0 = 1;wait_ms(interval);mbled1 = 1;wait_ms(interval);        
+        mbled2 = 1;wait_ms(interval);mbled3 = 1;wait_ms(interval);
+        interval++;
+        if (interval>60){
+             mbled0 = 0;mbled1 = 0;mbled2 = 0;mbled3 = 0;
+             mbled1 =1;wait_ms(interval); mbled2 = 1;
+             wait_ms(interval*10);
+             interval=0;
+        }                    
+        mbled2 = 0;wait_ms(interval);mbled1 = 0;wait_ms(interval);        
+        mbled0 = 0;wait_ms(interval);mbled3 = 0;wait_ms(interval);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 28 17:26:36 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e