selma tucak edis kunic

Dependencies:   mbed

Fork of zadatak1tim003grupa7 by tim003 tim003

main.cpp

Committer:
tim003
Date:
2014-03-13
Revision:
1:a38e1e4a66f2
Parent:
0:0a243510fd7b

File content as of revision 1:a38e1e4a66f2:

#include "mbed.h"

BusOut myled(dp23,dp24,dp25,dp26,dp27,dp5,dp6,dp28);
DigitalOut enable(dp14);
DigitalIn taster1(dp1);
DigitalIn taster2(dp2);
int main(){
    enable=0;
    int brojac=0;
    myled=0;
    int j;
    while(1) {
        j=0;
        if( taster1==1){
            for(int i=0;i<200;i++){
                if(taster1==0) j++;
            }
            if(j>40){
            if(brojac==255)brojac=0;
            myled=brojac;
            wait(0.25);
            brojac++;
            }
        }
        if(taster2==1){
            for(int i=0;i<200;i++){
                if(taster2==0) j++;
            }
            if(j>40){
            if(brojac==0){
                brojac=255;
            }
            myled=brojac;
            wait(0.25);
            brojac--;
            }
        }
    }
}