Enil Pajić Aida Pločo

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
tim007
Date:
Mon Mar 03 07:37:49 2014 +0000
Commit message:
LV1_G1_Tim007_Zad2

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 03 07:37:49 2014 +0000
@@ -0,0 +1,36 @@
+#include "mbed.h"
+ 
+DigitalOut myled(LED2);
+ 
+int main() {
+    while(1) {
+        myled = 0;
+        wait(1);
+        myled = 1;
+        wait(1);
+        const double e = 0.9/30.0;
+        double f = 1 + e;               // 1.03
+        double h = 1 - e;               // 1 - 0.03
+        for (int a = 0; a < 30; ++a)
+            {
+                myled = 0;              // Ukljucena
+                wait (f);               // za 1.03 pa 1.06, 1.09 ... pa 1.9
+                f += e;
+                myled = 1;              // Iskljucena
+                wait (h);               // za 0.97, pa 0.94 ... pa 0.1
+                h -= e;
+            }
+        f = 1 - e;
+        h = 1 + e;
+        for (int a = 0; a < 60; ++a)
+            {
+                myled = 0;
+                wait (f);
+                f -= e;
+                myled = 1;
+                wait (h);
+                h += e;
+ 
+            }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Mar 03 07:37:49 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file