Amer Šurković
/
Lab1_Zadatak4_v2BUS
Sto 7. Lab 1 Zadatak 4 v2 Amer Šurković Haris Imamović
Revision 0:8325893f5e40, committed 2016-03-06
- Comitter:
- 2016US_AmerSurkovic
- Date:
- Sun Mar 06 01:22:55 2016 +0000
- Commit message:
- Sto 7. Lab 1 Zadatak 4 v2 Amer ?urkovi? Haris Imamovi?
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 8325893f5e40 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Mar 06 01:22:55 2016 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" +#define dp23 P0_0 + +BusOut disp(dp23,dp24, dp25, dp26, dp27, dp5, dp6, dp28); +DigitalOut enable(dp14); + +int stepen(int n) { + int rez = 1; + for(int i = 0; i < n; i++) + rez *= 2; + + return rez; +} + +int main() { + enable = 0; + disp = 0; + int counter = 0; + + while(1) { + + if(counter == 9) { + counter = 0; + disp = 0; + } + else disp = stepen(counter); + + wait(0.2); + counter++; + } +}
diff -r 000000000000 -r 8325893f5e40 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Mar 06 01:22:55 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb \ No newline at end of file