Anesa Drakovac Amer Ratković

Dependencies:   mbed

Fork of drugi_zad by tim007 tim007

Files at this revision

API Documentation at this revision

Comitter:
tim007
Date:
Thu Mar 06 13:53:29 2014 +0000
Commit message:
LV1_Grupa5_Tim007_Zadatak2

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	Thu Mar 06 13:53:29 2014 +0000
@@ -0,0 +1,42 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+
+int main() {
+    int uzlazno=1; 
+    float u=1;
+    float i=1;
+     myled = 0;
+     wait(1);
+     myled = 1;
+     wait(1);
+    while(1) {
+        
+        if(uzlazno == 1)
+        {
+        u=u+0.06;
+         i=i-0.06;
+         myled = 0;
+         wait(u);
+      
+         myled = 1;
+         wait(i);
+            if(u>=1.9 || i<=0.1)
+            uzlazno=-1;
+        }
+        else
+        {
+            u=u-0.06;
+         i=i+0.06;
+         myled = 0;
+         wait(u);
+      
+         myled = 1;
+         wait(i);
+            if(i>=1.9 || u<=0.1)
+            uzlazno=1;
+            }
+        
+        
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Mar 06 13:53:29 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file