
Amra Dautbegović Ediba Žugor
main.cpp@0:07e3350465af, 2014-03-03 (annotated)
- Committer:
- tim004
- Date:
- Mon Mar 03 18:42:48 2014 +0000
- Revision:
- 0:07e3350465af
LV1-PAI-Grupa4-Tim004
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tim004 | 0:07e3350465af | 1 | #include "mbed.h" |
tim004 | 0:07e3350465af | 2 | |
tim004 | 0:07e3350465af | 3 | DigitalOut myled1(LED1); |
tim004 | 0:07e3350465af | 4 | |
tim004 | 0:07e3350465af | 5 | DigitalOut myled2(LED3); |
tim004 | 0:07e3350465af | 6 | |
tim004 | 0:07e3350465af | 7 | DigitalOut myled3(LED2); |
tim004 | 0:07e3350465af | 8 | |
tim004 | 0:07e3350465af | 9 | |
tim004 | 0:07e3350465af | 10 | int main() { |
tim004 | 0:07e3350465af | 11 | myled1 = 1; |
tim004 | 0:07e3350465af | 12 | myled2 = 1; |
tim004 | 0:07e3350465af | 13 | myled3 = 1; |
tim004 | 0:07e3350465af | 14 | double x=0.005; |
tim004 | 0:07e3350465af | 15 | double y=0.005; |
tim004 | 0:07e3350465af | 16 | |
tim004 | 0:07e3350465af | 17 | while(1) { |
tim004 | 0:07e3350465af | 18 | while(x<0.0099 && y>=0.0001){ |
tim004 | 0:07e3350465af | 19 | myled1 = 0; |
tim004 | 0:07e3350465af | 20 | myled2 = 1; |
tim004 | 0:07e3350465af | 21 | wait(x); |
tim004 | 0:07e3350465af | 22 | x=x+0.0000245; |
tim004 | 0:07e3350465af | 23 | myled1 = 1; |
tim004 | 0:07e3350465af | 24 | myled2 = 0; |
tim004 | 0:07e3350465af | 25 | wait(y); |
tim004 | 0:07e3350465af | 26 | y=y-0.0000245;} |
tim004 | 0:07e3350465af | 27 | while(x>=0.0001 && y<0.0099){ |
tim004 | 0:07e3350465af | 28 | myled1 = 0; |
tim004 | 0:07e3350465af | 29 | myled2 = 1; |
tim004 | 0:07e3350465af | 30 | wait(x); |
tim004 | 0:07e3350465af | 31 | x=x-0.0000245; |
tim004 | 0:07e3350465af | 32 | myled1 = 1; |
tim004 | 0:07e3350465af | 33 | myled2 = 0; |
tim004 | 0:07e3350465af | 34 | wait(y); |
tim004 | 0:07e3350465af | 35 | y=y+0.0000245; |
tim004 | 0:07e3350465af | 36 | } |
tim004 | 0:07e3350465af | 37 | |
tim004 | 0:07e3350465af | 38 | |
tim004 | 0:07e3350465af | 39 | } |
tim004 | 0:07e3350465af | 40 | } |