Anesa Drakovac Amer Ratković

Dependencies:   mbed

Committer:
tim007
Date:
Thu Mar 06 13:53:29 2014 +0000
Revision:
0:936716d22580
LV1_Grupa5_Tim007_Zadatak2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tim007 0:936716d22580 1 #include "mbed.h"
tim007 0:936716d22580 2
tim007 0:936716d22580 3 DigitalOut myled(LED1);
tim007 0:936716d22580 4
tim007 0:936716d22580 5 int main() {
tim007 0:936716d22580 6 int uzlazno=1;
tim007 0:936716d22580 7 float u=1;
tim007 0:936716d22580 8 float i=1;
tim007 0:936716d22580 9 myled = 0;
tim007 0:936716d22580 10 wait(1);
tim007 0:936716d22580 11 myled = 1;
tim007 0:936716d22580 12 wait(1);
tim007 0:936716d22580 13 while(1) {
tim007 0:936716d22580 14
tim007 0:936716d22580 15 if(uzlazno == 1)
tim007 0:936716d22580 16 {
tim007 0:936716d22580 17 u=u+0.06;
tim007 0:936716d22580 18 i=i-0.06;
tim007 0:936716d22580 19 myled = 0;
tim007 0:936716d22580 20 wait(u);
tim007 0:936716d22580 21
tim007 0:936716d22580 22 myled = 1;
tim007 0:936716d22580 23 wait(i);
tim007 0:936716d22580 24 if(u>=1.9 || i<=0.1)
tim007 0:936716d22580 25 uzlazno=-1;
tim007 0:936716d22580 26 }
tim007 0:936716d22580 27 else
tim007 0:936716d22580 28 {
tim007 0:936716d22580 29 u=u-0.06;
tim007 0:936716d22580 30 i=i+0.06;
tim007 0:936716d22580 31 myled = 0;
tim007 0:936716d22580 32 wait(u);
tim007 0:936716d22580 33
tim007 0:936716d22580 34 myled = 1;
tim007 0:936716d22580 35 wait(i);
tim007 0:936716d22580 36 if(i>=1.9 || u<=0.1)
tim007 0:936716d22580 37 uzlazno=1;
tim007 0:936716d22580 38 }
tim007 0:936716d22580 39
tim007 0:936716d22580 40
tim007 0:936716d22580 41 }
tim007 0:936716d22580 42 }