Anesa Drakovac Amer Ratković

Dependencies:   mbed

Fork of drugi_zad by tim007 tim007

main.cpp

Committer:
tim007
Date:
2014-03-06
Revision:
0:936716d22580

File content as of revision 0:936716d22580:

#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;
            }
        
        
    }
}