Lab 1 zadatak 2 Adam Stanic i Alen Sjenicaku

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
2016US_AdamStanic
Date:
Mon Mar 07 10:37:49 2016 +0000
Commit message:
Lab 1 zadatak 2 Adam Stanic i Alen Sjenicaku

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	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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Mar 07 10:37:49 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb
\ No newline at end of file