Leds variable flash

Dependencies:   mbed

Revision:
0:e9da4640a8a0
--- /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