![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Ognjen Arbutina 2020/0581
Revision 0:5d00ada617a6, committed 2021-11-06
- Comitter:
- arbutinao
- Date:
- Sat Nov 06 08:52:15 2021 +0000
- Commit message:
- Ognjen Arbutina 2020/0581
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 5d00ada617a6 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Nov 06 08:52:15 2021 +0000 @@ -0,0 +1,71 @@ +/* +* Sekcija predvidjena za uvoz biblioteka +*/ +#include "mbed.h" + + +/* +*Sekcija za definisanje direktiva i glavnih promenljivih +*/ + +#define DISPLAY_ON 0 +#define WAIT_MS 50 + + +BusOut display2PC_7, PA_10, PA_9, PA_8, PB_10, PB_5, PB_4 ); +DigitalIn buttonSW1(PC_8); +BusOut digitalNum1(PB_6, PA_10, PA_9, PA_8, PB_10, PB_5, PB_4, PB_3,PC_7); + +/* +*Sekcija za pisanje glavne funckije i korisničkih (dodatnih, pomoćnih) funkcija +*/ + +void incrementation (void); +int main() +{ + static char button_released = 0; + //Prvi zadatak + while(1) + { + display2.write(DISPLAY_ON); + wait_ms(WAIT_MS); + + //Drugi zadatak + if (!buttonSW1) + { + if (button_released) + { + incrementation(); + button_released=0; + } + } + else + { + button_released =1; + } + } + +} + +void incrementation () +{ + switch(1) + { + case 1 digitalNum1 + case 2 digitalNum1 + case 3 digitalNum1 + case 4 digitalNum1 + case 5 digitalNum1 + case 6 digitalNum1 + case 7 digitalNum1 + case 8 digitalNum1 + case 9 digitalNum1 + case 10 digitalNum1 + case 11 digitalNum1 + case 12 digitalNum1 + case 13 digitalNum1 + case 14 digitalNum1 + case 15 digitalNum1 + } +} +
diff -r 000000000000 -r 5d00ada617a6 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Nov 06 08:52:15 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file