Maedeh Mousavi Haris Šemić

Dependencies:   mbed

Fork of LV1_Grupa6_Tim004 by tim004 tim004

Files at this revision

API Documentation at this revision

Comitter:
tim004
Date:
Thu Mar 06 16:00:52 2014 +0000
Parent:
0:4da8338a4685
Commit message:
LV1 - PAI - Grupa 6 - Tim004

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 4da8338a4685 -r 443c6585901b main.cpp
--- a/main.cpp	Thu Mar 06 15:27:04 2014 +0000
+++ b/main.cpp	Thu Mar 06 16:00:52 2014 +0000
@@ -1,11 +1,28 @@
 #include "mbed.h"
-DigitalOut myled(LED1);
+DigitalOut myled(LED3);
 
 int main(){
-while(1) {
-myled = 1 ;
-wait(1);
-myled = 0 ;
-wait (1) ;
+float i = 1, j=1;
+while(1)
+{ 
+    while (i<=1.9 && j>= 0.1)
+    {
+        myled = 0 ;
+        wait(i);
+        myled = 1 ;
+        wait(j) ;
+        i+=0.06;
+        j-=0.06;
+    }
+    
+    while (i>=0.1 && j<= 1.9)
+    {
+        myled = 0 ;
+        wait(i);
+        myled = 1 ;
+        wait(j) ;
+        i-=0.06;
+        j+=0.06;
+    }
 }
 }
\ No newline at end of file