tim003 tim003
/
LV1-Grupa3-tim003-zadatak2
Ilma Kurtović Adnan Kičin
Fork of LV1-Grupa3-tim003-Zadatak1 by
main.cpp@2:f68f6c45b79c, 2014-03-03 (annotated)
- Committer:
- tim003
- Date:
- Mon Mar 03 16:03:51 2014 +0000
- Revision:
- 2:f68f6c45b79c
- Parent:
- 1:b56d4f08aa46
LV1-PAI-Grupa3-tim003
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tim003 | 0:218fa596e8cf | 1 | #include "mbed.h" |
tim003 | 0:218fa596e8cf | 2 | |
tim003 | 0:218fa596e8cf | 3 | DigitalOut myled(LED2); |
tim003 | 0:218fa596e8cf | 4 | |
tim003 | 2:f68f6c45b79c | 5 | |
tim003 | 0:218fa596e8cf | 6 | int main(){ |
tim003 | 0:218fa596e8cf | 7 | while(1) { |
tim003 | 2:f68f6c45b79c | 8 | float i=1; |
tim003 | 2:f68f6c45b79c | 9 | while(i<=1.9){ |
tim003 | 2:f68f6c45b79c | 10 | myled=0; |
tim003 | 2:f68f6c45b79c | 11 | wait(i+0.03); |
tim003 | 2:f68f6c45b79c | 12 | myled=1; |
tim003 | 2:f68f6c45b79c | 13 | wait(2-i); |
tim003 | 2:f68f6c45b79c | 14 | } |
tim003 | 2:f68f6c45b79c | 15 | while(i>=0.1){ |
tim003 | 2:f68f6c45b79c | 16 | myled=1; |
tim003 | 2:f68f6c45b79c | 17 | wait(i-0.0105); |
tim003 | 2:f68f6c45b79c | 18 | myled=0; |
tim003 | 2:f68f6c45b79c | 19 | wait(2-i); |
tim003 | 2:f68f6c45b79c | 20 | } |
tim003 | 2:f68f6c45b79c | 21 | while(i<=1.9){ |
tim003 | 2:f68f6c45b79c | 22 | myled=0; |
tim003 | 2:f68f6c45b79c | 23 | wait(i+0.0105); |
tim003 | 2:f68f6c45b79c | 24 | myled=1; |
tim003 | 2:f68f6c45b79c | 25 | wait(2-i); |
tim003 | 2:f68f6c45b79c | 26 | } |
tim003 | 2:f68f6c45b79c | 27 | } |
tim003 | 2:f68f6c45b79c | 28 | } |