tim004 tim004
/
Lab6_Zad2_Priprema
AnesaD
Revision 0:9cdec4155a6b, committed 2014-04-09
- Comitter:
- tim004
- Date:
- Wed Apr 09 23:02:30 2014 +0000
- Commit message:
- AnesaD
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Apr 09 23:02:30 2014 +0000 @@ -0,0 +1,37 @@ +#include "mbed.h" + +BusOut prikaz1(dp26, dp25, dp24, dp23); +BusOut prikaz2(dp28, dp6, dp5, dp27); +DigitalOut enable(dp14); +InterruptIn taster(dp1); + +const float T(2.0); +int brojac1(0); +int brojac2(0); + +Ticker tiker; +Timer timer; + +void broji(){ + brojac1 = (brojac1 + 1); + prikaz1 = brojac1; + prikaz2 = brojac2; +} + +void funkcija(){ + if(timer.read_ms() > 200) + brojac2=(brojac2+1); + timer.reset(); +} + +int main(){ + enable = 0; + + prikaz1 = brojac1; + prikaz2 = brojac2; + + timer.start(); + taster.rise(&funkcija); + tiker.attach(&broji, T); + while(1){} +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Apr 09 23:02:30 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6473597d706e \ No newline at end of file