LV2_Grupa8_Tim008_Zadatak1_AdmiraHusic_EnsarSarajcic

Dependencies:   mbed

Committer:
pai2015admirahusic
Date:
Thu Mar 12 18:34:26 2015 +0000
Revision:
0:84fedfb4141c
LV2_Grupa8_Tim008_Zadatak1_AdmiraHusic_EnsarSarajcic

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pai2015admirahusic 0:84fedfb4141c 1 #include "mbed.h"
pai2015admirahusic 0:84fedfb4141c 2 #define dp23 P0_0
pai2015admirahusic 0:84fedfb4141c 3
pai2015admirahusic 0:84fedfb4141c 4
pai2015admirahusic 0:84fedfb4141c 5 BusOut ledovi(dp23, dp24, dp25, dp26, dp27, dp5, dp6, dp28);
pai2015admirahusic 0:84fedfb4141c 6
pai2015admirahusic 0:84fedfb4141c 7 DigitalIn taster(dp1);
pai2015admirahusic 0:84fedfb4141c 8 DigitalOut enable(dp14);
pai2015admirahusic 0:84fedfb4141c 9
pai2015admirahusic 0:84fedfb4141c 10
pai2015admirahusic 0:84fedfb4141c 11 int main() {
pai2015admirahusic 0:84fedfb4141c 12 enable=0;
pai2015admirahusic 0:84fedfb4141c 13 int i=0;
pai2015admirahusic 0:84fedfb4141c 14
pai2015admirahusic 0:84fedfb4141c 15 while(1) {
pai2015admirahusic 0:84fedfb4141c 16
pai2015admirahusic 0:84fedfb4141c 17 if(taster==1){
pai2015admirahusic 0:84fedfb4141c 18
pai2015admirahusic 0:84fedfb4141c 19 if(i==0) i=255;
pai2015admirahusic 0:84fedfb4141c 20 else i--;
pai2015admirahusic 0:84fedfb4141c 21 ledovi=i;
pai2015admirahusic 0:84fedfb4141c 22 }
pai2015admirahusic 0:84fedfb4141c 23
pai2015admirahusic 0:84fedfb4141c 24 else {
pai2015admirahusic 0:84fedfb4141c 25
pai2015admirahusic 0:84fedfb4141c 26 if(i==255) i=0;
pai2015admirahusic 0:84fedfb4141c 27 else i++;
pai2015admirahusic 0:84fedfb4141c 28 ledovi=i;
pai2015admirahusic 0:84fedfb4141c 29 }
pai2015admirahusic 0:84fedfb4141c 30 wait(1);
pai2015admirahusic 0:84fedfb4141c 31 }
pai2015admirahusic 0:84fedfb4141c 32
pai2015admirahusic 0:84fedfb4141c 33
pai2015admirahusic 0:84fedfb4141c 34
pai2015admirahusic 0:84fedfb4141c 35 }
pai2015admirahusic 0:84fedfb4141c 36