Lab 1 zadatak 2 Adam Stanic i Alen Sjenicaku

Dependencies:   mbed

Revision:
0:330d407cca14
diff -r 000000000000 -r 330d407cca14 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Mar 07 10:37:49 2016 +0000
@@ -0,0 +1,65 @@
+#include "mbed.h"
+
+DigitalOut crvena(LED_RED);
+DigitalOut zelena(LED_GREEN);
+DigitalOut plava(LED_BLUE);
+
+
+int main()
+{
+    crvena=1;
+    zelena=1;
+    plava=1;
+    
+    
+    float vrijeme=1;
+    
+    while(vrijeme>0.1)
+    {
+        crvena=0;
+        wait(vrijeme);
+        crvena=1;
+        wait(vrijeme);
+        zelena=0;
+        wait(vrijeme);
+        zelena=1;
+        wait(vrijeme);
+        
+        plava=0;
+        wait(vrijeme);
+        plava=1;
+        wait(vrijeme);
+        
+        vrijeme=vrijeme-0.1;
+        
+        }
+        
+        vrijeme=0.1;
+        
+        crvena=1;
+        plava=1;
+        zelena=1;
+        
+        
+        while(1)
+        {
+            crvena=0;
+        wait(vrijeme);
+        crvena=1;
+        wait(vrijeme);
+        zelena=0;
+        wait(vrijeme);
+        zelena=1;
+        wait(vrijeme);
+        
+        plava=0;
+        wait(vrijeme);
+        plava=1;
+        wait(vrijeme);
+            
+            }
+    
+            
+            
+        
+    }
\ No newline at end of file