Rev 1748 | Rev 1749 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #include "main.h" |
1 | #include "main.h" |
2 | |
2 | |
3 | #case |
3 | #case |
4 | |
4 | |
5 | #define REVERS 2 // 2*256 ms = 0,5 s |
5 | #define REVERS 3 // 2*256 ms = 0,75 s |
6 | #define GO 117 // 117*256 ms = 30 s |
6 | #define GO 117 // 117*256 ms = 30 s |
7 | #define GO_ZALUZIE 5 // 5*256 ms = 1,25 s |
7 | #define GO_ZALUZIE 6 // cca 1,5 s |
8 | #define RECEIVE 12 // 3 s |
8 | #define RECEIVE 10 // cca 2,6 s |
9 | |
9 | |
10 | #define S105A PIN_A0 |
10 | #define S105A PIN_A0 |
11 | #define R110NU PIN_A1 |
11 | #define R110NU PIN_A1 |
12 | #define R110ND PIN_A2 |
12 | #define R110ND PIN_A2 |
13 | #define S104A PIN_A3 |
13 | #define S104A PIN_A3 |
Line 215... | Line 215... | ||
215 | |
215 | |
216 | r103V=STOP; // Rolety jsou zastaveny |
216 | r103V=STOP; // Rolety jsou zastaveny |
217 | r110N=STOP; |
217 | r110N=STOP; |
218 | r104V=STOP; |
218 | r104V=STOP; |
219 | r104J=STOP; |
219 | r104J=STOP; |
- | 220 | tr103V=0; |
|
- | 221 | tr110N=0; |
|
- | 222 | tr104V=0; |
|
- | 223 | tr104J=0; |
|
220 | |
224 | |
221 | output_high(LED1); // Indikace restartu |
225 | output_high(LED1); // Indikace restartu |
222 | delay_ms(100); |
226 | delay_ms(100); |
223 | output_low(LED1); |
227 | output_low(LED1); |
224 | delay_ms(30); |
228 | delay_ms(30); |
225 | output_high(LED1); |
229 | output_high(LED1); |
Line 346... | Line 350... | ||
346 | if(tr110N==0) {r110N=STOP;} |
350 | if(tr110N==0) {r110N=STOP;} |
347 | break; |
351 | break; |
348 | case REVERS_UP: |
352 | case REVERS_UP: |
349 | OFF(R110NU); |
353 | OFF(R110NU); |
350 | OFF(R110ND); |
354 | OFF(R110ND); |
351 | if(tr110N==0) {r110N=GO_UP; tr110N=GO_ZALUZIE;} |
355 | if(tr110N==0) {r110N=GO_UP; tr110N=GO_ZALUZIE;} // Nahoru pouze kratce na otevreni zaluzie |
352 | break; |
356 | break; |
353 | case REVERS_DOWN: |
357 | case REVERS_DOWN: |
354 | OFF(R110NU); |
358 | OFF(R110NU); |
355 | OFF(R110ND); |
359 | OFF(R110ND); |
356 | if(tr110N==0) {r110N=GO_DOWN; tr110N=GO_ZALUZIE;} |
360 | if(tr110N==0) {r110N=GO_DOWN; tr110N=2*GO_ZALUZIE;} // Dolu jede dele, aby se najelo na koncak a zatemnilo. |
357 | break; |
361 | break; |
358 | } |
362 | } |
359 | /* |
363 | /* |
360 | switch(r110A) |
364 | switch(r110A) |
361 | { |
365 | { |