ping-pong
nestooo
PozicijaOdbijaca.cpp@0:8f75fa19100b, 2021-02-22 (annotated)
- Committer:
- atopcic
- Date:
- Mon Feb 22 08:23:02 2021 +0000
- Revision:
- 0:8f75fa19100b
datoteke
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
atopcic | 0:8f75fa19100b | 1 | // funkcija odbijača - potenciometri: |
atopcic | 0:8f75fa19100b | 2 | |
atopcic | 0:8f75fa19100b | 3 | #include "PozicijaOdbijaca.h" |
atopcic | 0:8f75fa19100b | 4 | |
atopcic | 0:8f75fa19100b | 5 | AnalogIn Pot1(A0); |
atopcic | 0:8f75fa19100b | 6 | AnalogIn Pot2(A1); |
atopcic | 0:8f75fa19100b | 7 | int Igrac1Pozicija,Igrac2Pozicija; |
atopcic | 0:8f75fa19100b | 8 | extern int polje[8][8]; |
atopcic | 0:8f75fa19100b | 9 | void pozicija_odbijaca(void){ |
atopcic | 0:8f75fa19100b | 10 | |
atopcic | 0:8f75fa19100b | 11 | Igrac1Pozicija=Pot1*5; |
atopcic | 0:8f75fa19100b | 12 | Igrac2Pozicija=Pot2*5; |
atopcic | 0:8f75fa19100b | 13 | |
atopcic | 0:8f75fa19100b | 14 | for(int i = 0; i < 8; i++) |
atopcic | 0:8f75fa19100b | 15 | { |
atopcic | 0:8f75fa19100b | 16 | if(i >= Igrac1Pozicija && i < Igrac1Pozicija + 3) polje[7][i] = 1; |
atopcic | 0:8f75fa19100b | 17 | else polje[7][i] = 0; |
atopcic | 0:8f75fa19100b | 18 | |
atopcic | 0:8f75fa19100b | 19 | if(i >= Igrac2Pozicija && i < Igrac2Pozicija + 3) polje[0][i] = 1; |
atopcic | 0:8f75fa19100b | 20 | else polje[0][i] = 0; |
atopcic | 0:8f75fa19100b | 21 | } |
atopcic | 0:8f75fa19100b | 22 | } |
atopcic | 0:8f75fa19100b | 23 |