tim003 tim003
/
zadatak2
selma tucak edis kunic
Fork of zadatak1tim003grupa7 by
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--; } } } }