Amer Šurković
/
Lab1_Zadatak2
Sto 7. Lab 1 Zadatak 2 Amer Šurković Haris Imamović
main.cpp@0:59bcdcfe0564, 2016-03-06 (annotated)
- Committer:
- 2016US_AmerSurkovic
- Date:
- Sun Mar 06 01:21:26 2016 +0000
- Revision:
- 0:59bcdcfe0564
Sto 7. Lab 1 Zadatak 2 Amer ?urkovi? Haris Imamovi?
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
2016US_AmerSurkovic | 0:59bcdcfe0564 | 1 | #include "mbed.h" |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 2 | |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 3 | DigitalOut ledRed(LED_RED); |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 4 | DigitalOut ledGreen(LED_GREEN); |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 5 | DigitalOut ledBlue(LED_BLUE); |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 6 | |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 7 | int main() { |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 8 | ledRed = ledGreen = ledBlue = 1; |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 9 | float c = 1; |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 10 | |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 11 | while(1) { |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 12 | |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 13 | ledRed = 0; |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 14 | wait(c); |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 15 | ledRed = 1; |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 16 | |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 17 | |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 18 | ledGreen = 0; |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 19 | wait(c); |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 20 | ledGreen = 1; |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 21 | |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 22 | ledBlue = 0; |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 23 | wait(c); |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 24 | ledBlue = 1; |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 25 | |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 26 | if(c>0.1) c -= 0.1; |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 27 | } |
2016US_AmerSurkovic | 0:59bcdcfe0564 | 28 | } |