Sto 7. Lab 1 Zadatak 2 Amer Šurković Haris Imamović

Dependencies:   mbed

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?

UserRevisionLine numberNew 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 }