Lab 1 zadatak 2 Adam Stanic i Alen Sjenicaku

Dependencies:   mbed

Committer:
2016US_AdamStanic
Date:
Mon Mar 07 10:37:49 2016 +0000
Revision:
0:330d407cca14
Lab 1 zadatak 2 Adam Stanic i Alen Sjenicaku

Who changed what in which revision?

UserRevisionLine numberNew contents of line
2016US_AdamStanic 0:330d407cca14 1 #include "mbed.h"
2016US_AdamStanic 0:330d407cca14 2
2016US_AdamStanic 0:330d407cca14 3 DigitalOut crvena(LED_RED);
2016US_AdamStanic 0:330d407cca14 4 DigitalOut zelena(LED_GREEN);
2016US_AdamStanic 0:330d407cca14 5 DigitalOut plava(LED_BLUE);
2016US_AdamStanic 0:330d407cca14 6
2016US_AdamStanic 0:330d407cca14 7
2016US_AdamStanic 0:330d407cca14 8 int main()
2016US_AdamStanic 0:330d407cca14 9 {
2016US_AdamStanic 0:330d407cca14 10 crvena=1;
2016US_AdamStanic 0:330d407cca14 11 zelena=1;
2016US_AdamStanic 0:330d407cca14 12 plava=1;
2016US_AdamStanic 0:330d407cca14 13
2016US_AdamStanic 0:330d407cca14 14
2016US_AdamStanic 0:330d407cca14 15 float vrijeme=1;
2016US_AdamStanic 0:330d407cca14 16
2016US_AdamStanic 0:330d407cca14 17 while(vrijeme>0.1)
2016US_AdamStanic 0:330d407cca14 18 {
2016US_AdamStanic 0:330d407cca14 19 crvena=0;
2016US_AdamStanic 0:330d407cca14 20 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 21 crvena=1;
2016US_AdamStanic 0:330d407cca14 22 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 23 zelena=0;
2016US_AdamStanic 0:330d407cca14 24 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 25 zelena=1;
2016US_AdamStanic 0:330d407cca14 26 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 27
2016US_AdamStanic 0:330d407cca14 28 plava=0;
2016US_AdamStanic 0:330d407cca14 29 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 30 plava=1;
2016US_AdamStanic 0:330d407cca14 31 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 32
2016US_AdamStanic 0:330d407cca14 33 vrijeme=vrijeme-0.1;
2016US_AdamStanic 0:330d407cca14 34
2016US_AdamStanic 0:330d407cca14 35 }
2016US_AdamStanic 0:330d407cca14 36
2016US_AdamStanic 0:330d407cca14 37 vrijeme=0.1;
2016US_AdamStanic 0:330d407cca14 38
2016US_AdamStanic 0:330d407cca14 39 crvena=1;
2016US_AdamStanic 0:330d407cca14 40 plava=1;
2016US_AdamStanic 0:330d407cca14 41 zelena=1;
2016US_AdamStanic 0:330d407cca14 42
2016US_AdamStanic 0:330d407cca14 43
2016US_AdamStanic 0:330d407cca14 44 while(1)
2016US_AdamStanic 0:330d407cca14 45 {
2016US_AdamStanic 0:330d407cca14 46 crvena=0;
2016US_AdamStanic 0:330d407cca14 47 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 48 crvena=1;
2016US_AdamStanic 0:330d407cca14 49 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 50 zelena=0;
2016US_AdamStanic 0:330d407cca14 51 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 52 zelena=1;
2016US_AdamStanic 0:330d407cca14 53 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 54
2016US_AdamStanic 0:330d407cca14 55 plava=0;
2016US_AdamStanic 0:330d407cca14 56 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 57 plava=1;
2016US_AdamStanic 0:330d407cca14 58 wait(vrijeme);
2016US_AdamStanic 0:330d407cca14 59
2016US_AdamStanic 0:330d407cca14 60 }
2016US_AdamStanic 0:330d407cca14 61
2016US_AdamStanic 0:330d407cca14 62
2016US_AdamStanic 0:330d407cca14 63
2016US_AdamStanic 0:330d407cca14 64
2016US_AdamStanic 0:330d407cca14 65 }