tim008 tim008
/
LV2_Grupa6_Tim008_zad1
Haris Spahić Josip Kvesić
Diff: main.cpp
- Revision:
- 0:53fae77a287d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 13 15:51:02 2014 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" + +BusOut myled(dp23,dp24,dp25,dp26,dp27,dp5,dp6,dp28); +DigitalOut enable(dp14); +DigitalIn taster(dp1); +int main() { + enable=0; + int brojac=0; + while(1) { + if(taster==0){ + myled=brojac; + brojac++; + wait(1); + if(brojac>255) brojac=0; + } + else if(taster==1){ + myled=brojac; + brojac--; + wait(1); + if(brojac<0) brojac=255; + } + } +}