ping pong projekt
Dependencies: interupt mbed resetpolja pozicijaLoptice resetALL Ispis PozicijaOdbijaca
projekt je izveden s 8x8 led matricom na kojoj se igra ping pon pomoću potenciometara.
Revision 0:e7d047a7fe29, committed 2021-02-22
- Comitter:
- atopcic
- Date:
- Mon Feb 22 08:33:54 2021 +0000
- Commit message:
- datoteka
Changed in this revision
diff -r 000000000000 -r e7d047a7fe29 Ispis.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Ispis.lib Mon Feb 22 08:33:54 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/teams/TVZ2020/code/Ispis/#ccb8b3997ba7
diff -r 000000000000 -r e7d047a7fe29 PozicijaOdbijaca.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PozicijaOdbijaca.lib Mon Feb 22 08:33:54 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/atopcic/code/PozicijaOdbijaca/#8f75fa19100b
diff -r 000000000000 -r e7d047a7fe29 interupt.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/interupt.lib Mon Feb 22 08:33:54 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/atopcic/code/interupt/#11c592a697fb
diff -r 000000000000 -r e7d047a7fe29 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Feb 22 08:33:54 2021 +0000 @@ -0,0 +1,50 @@ +#include "mbed.h" +#include "resetpolja.h" +#include "Ispis.h" +#include "PozicijaOdbijaca.h" +#include "pozicijaLoptice.h" +#include "reset_polja.h" +#include "Interupt.h" + +extern int polje[8][8]; +extern int StartStop; +extern Timer timer1,timer3,debounce; +Timer timer2; +extern InterruptIn button; + +void ispis(void); +void pozicija_odbijaca(void); +void PozicijaLoptice (void); +void ResetPoljaLoptice (void); +void ResetPolja (void); +void toggle(void); + +int main() +{ + L8=0; L9=0; L10=0; L11=0; L12=0; L13=0; L14=0; L15=0; G1=0; G2=0; G3=0; + timer1.start(); // start timer counting + timer2.start(); + timer3.start(); + + while(1) { + + if(timer2.read_ms() >= 400){ + ResetPoljaLoptice(); + PozicijaLoptice(); + timer2.reset(); + timer3.reset(); + } + + pozicija_odbijaca(); + ispis(); + debounce.start(); + button.rise(&toggle); + while(StartStop==0){ResetPolja(); ispis();} +} +} + + + + + +
diff -r 000000000000 -r e7d047a7fe29 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Feb 22 08:33:54 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file
diff -r 000000000000 -r e7d047a7fe29 pozicijaLoptice.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pozicijaLoptice.lib Mon Feb 22 08:33:54 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/atopcic/code/pozicijaLoptice/#7aa751de1e82
diff -r 000000000000 -r e7d047a7fe29 resetALL.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resetALL.lib Mon Feb 22 08:33:54 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/atopcic/code/resetALL/#940bc7e11621
diff -r 000000000000 -r e7d047a7fe29 resetpolja.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resetpolja.lib Mon Feb 22 08:33:54 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/atopcic/code/resetpolja/#406a3c5e4754