tim003 tim003
/
Zadataktim3
Anes Luckin Selma Tucak
Revision 0:87d8d39674fb, committed 2014-03-20
- Comitter:
- tim003
- Date:
- Thu Mar 20 18:27:58 2014 +0000
- Commit message:
- LV3-PAI-Grupa7-Tim3-Zadatak1
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 |
diff -r 000000000000 -r 87d8d39674fb main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Mar 20 18:27:58 2014 +0000 @@ -0,0 +1,50 @@ +#include "mbed.h" + +BusOut led(dp26, dp27, dp5, dp6, dp28, dp1, dp2); +BusOut dec(dp23, dp24, dp25); +BusOut tacka(dp4); + +int broj[10] = {0x40, 0x79, 0x24, 0x30, 0x19, 0x12, 0x02, 0x78, 0x00, 0x10}; + +Timer brojac; + +void funk(float v) +{ + int des= (int) (v)/10; + int jed = (int) (v)%10; + int stot = (v -int(v))*10; + led=broj[stot]; + dec=3; +wait_ms(2); + +led=broj[jed]; +dec=5; +tacka=0; + +wait_ms(2); + + +tacka=1; + led=broj[des]; +dec=6; + + wait_ms(2); + + dec=7; + +} + +int main() { + dec = 0; + led = broj[0]; + wait(2); + brojac.start(); + float v = 0; + + while(1) { + + if(v<=12.3) + v = brojac.read(); + funk(v); + } +}
diff -r 000000000000 -r 87d8d39674fb mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Mar 20 18:27:58 2014 +0000 @@ -0,0 +1,1 @@ +http://world3.dev.mbed.org/users/mbed_official/code/mbed/builds/824293ae5e43 \ No newline at end of file