tim007 tim007
/
LV1_G1_Tim007_Zad3
Enil Pajić Aida Pločo
main.cpp@0:6095153f7e38, 2014-03-03 (annotated)
- Committer:
- tim007
- Date:
- Mon Mar 03 08:00:05 2014 +0000
- Revision:
- 0:6095153f7e38
LV1_G1_Tim007_Zad3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tim007 | 0:6095153f7e38 | 1 | #include "mbed.h" |
tim007 | 0:6095153f7e38 | 2 | |
tim007 | 0:6095153f7e38 | 3 | DigitalOut L1(LED1); |
tim007 | 0:6095153f7e38 | 4 | DigitalOut L2(LED2); |
tim007 | 0:6095153f7e38 | 5 | DigitalOut L3(LED3); |
tim007 | 0:6095153f7e38 | 6 | |
tim007 | 0:6095153f7e38 | 7 | int main() { |
tim007 | 0:6095153f7e38 | 8 | double x = 0; |
tim007 | 0:6095153f7e38 | 9 | while(1) { |
tim007 | 0:6095153f7e38 | 10 | L3 = L2 = 1; |
tim007 | 0:6095153f7e38 | 11 | L1 = 0; |
tim007 | 0:6095153f7e38 | 12 | wait(1.5 - x); |
tim007 | 0:6095153f7e38 | 13 | L1 = 1; |
tim007 | 0:6095153f7e38 | 14 | L2 = 0; |
tim007 | 0:6095153f7e38 | 15 | wait(1.5 - x); |
tim007 | 0:6095153f7e38 | 16 | L2 = 1; |
tim007 | 0:6095153f7e38 | 17 | L3 = 0; |
tim007 | 0:6095153f7e38 | 18 | wait(1.5 - x); |
tim007 | 0:6095153f7e38 | 19 | if (x <= 1.5) |
tim007 | 0:6095153f7e38 | 20 | x += 0.2; |
tim007 | 0:6095153f7e38 | 21 | else x = 0; |
tim007 | 0:6095153f7e38 | 22 | } |
tim007 | 0:6095153f7e38 | 23 | } |