sdfkasdlfkasd

Dependencies:   mbed

Fork of HelloWorld by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
Pithikos
Date:
Mon Sep 22 15:15:32 2014 +0000
Parent:
1:03c191369089
Commit message:
changed

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 03c191369089 -r 1921d881d00e main.cpp
--- a/main.cpp	Sun Jan 01 20:57:57 2012 +0000
+++ b/main.cpp	Mon Sep 22 15:15:32 2014 +0000
@@ -1,12 +1,55 @@
 #include "mbed.h"
 
-DigitalOut myled(LED1);
+DigitalOut myled1(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled3(LED3);
+DigitalOut myled4(LED4);
 
 int main() {
+    
+    float i = 0.0;
+    
     while(1) {
-        myled = 1;
-        wait(0.2);
-        myled = 0;
-        wait(0.2);
+        i+=0.01 ;
+        
+        
+        myled1 = 1;
+        myled2 = 0;
+        myled3 = 0;
+        myled4 = 0;
+        
+        wait(i);
+        
+        myled1 = 0;
+        myled2 = 1;
+        myled3 = 0;
+        myled4 = 0;
+        
+        wait(i);
+        
+        myled1 = 0;
+        myled2 = 0;
+        myled3 = 1;
+        myled4 = 0;
+        
+        wait(i);
+        
+        myled1 = 0;
+        myled2 = 0;
+        myled3 = 0;
+        myled4 = 1;
+        
+        wait(i);
+        
+        if (i >= 0.1) {
+            i=0.0;
+            myled1 = 1;
+            myled2 = 1;
+            myled3 = 1;
+            myled4 = 1;
+            wait(0.1);  
+        }
+        
+        
     }
-}
+}
\ No newline at end of file