Line 5... |
Line 5... |
5 |
|
5 |
|
6 |
<Roleta/Svetlo><#patro><#mistnost><Nord/Jih/Vychod/Zapad/A/B><Up/Down> |
6 |
<Roleta/Svetlo><#patro><#mistnost><Nord/Jih/Vychod/Zapad/A/B><Up/Down> |
7 |
R2aNU - roleta, 2. n.p., mistnost 10, sever, nahoru |
7 |
R2aNU - roleta, 2. n.p., mistnost 10, sever, nahoru |
8 |
S12A - svetlo, 1. n.p., mistnost 2, prostredni |
8 |
S12A - svetlo, 1. n.p., mistnost 2, prostredni |
9 |
|
9 |
|
- |
|
10 |
Rozmisteni desek: |
- |
|
11 |
|
- |
|
12 |
[CAN] |
- |
|
13 |
[IN J] [IN D] |
- |
|
14 |
[OUT A] [CPU] |
- |
|
15 |
|
- |
|
16 |
[OUT F] [OUT B] [OUT E] |
- |
|
17 |
|
10 |
*/ |
18 |
*/ |
11 |
#include "main.h" |
19 |
#include "main.h" |
12 |
|
20 |
|
13 |
#case |
21 |
#case |
14 |
|
22 |
|
Line 42... |
Line 50... |
42 |
//#define PIN_C4 31764 |
50 |
//#define PIN_C4 31764 |
43 |
//#define PIN_C5 31765 |
51 |
//#define PIN_C5 31765 |
44 |
//#define PIN_C6 31766 //TX |
52 |
//#define PIN_C6 31766 //TX |
45 |
//#define PIN_C7 31767 //RX |
53 |
//#define PIN_C7 31767 //RX |
46 |
|
54 |
|
47 |
//#define O... PIN_F0 // t1 |
55 |
#define OR104VU PIN_F0 // t1 Roleta laborator vychod |
48 |
//#define O... PIN_F1 // t2 |
56 |
#define OR104VD PIN_F1 // t2 |
49 |
//#define O... PIN_F2 // t3 |
57 |
//#define O... PIN_F2 // t3 |
50 |
//#define O... PIN_F3 // t4 |
58 |
//#define O... PIN_F3 // t4 |
51 |
//#define O... PIN_F4 // t5 |
59 |
//#define O... PIN_F4 // t5 |
52 |
//#define O... PIN_F5 // t6 |
60 |
//#define O... PIN_F5 // t6 |
53 |
//#define O... PIN_F6 // t7 |
61 |
//#define O... PIN_F6 // t7 |
54 |
//#define O... PIN_F7 // t8 |
62 |
//#define O... PIN_F7 // t8 |
55 |
|
63 |
|
56 |
//#define I.... input(PIN_D0) // A |
64 |
//#define I.... input(PIN_D0) // A |
57 |
#define IS201AZ input(PIN_D1) // B Vypinac chodba 2.n.p. zapad u Kaklika |
65 |
#define IS201AZ input(PIN_D1) // B Vypinac chodba 2.n.p. zapad u Kaklika |
58 |
#define IS207AJ input(PIN_D2) // C Vypinac klubovna |
66 |
#define IS207AJ input(PIN_D2) // C Vypinac klubovna |
59 |
#define IR207VU input(PIN_D3) // D Vypinac roleta klubovna nahoru |
67 |
#define IR207VD input(PIN_D3) // D Vypinac roleta klubovna dolu |
60 |
#define IR207VD input(PIN_D4) // E Vypinac roleta klubovna dolu |
68 |
#define IR207VU input(PIN_D4) // E Vypinac roleta klubovna nahoru |
61 |
#define IS201AV input(PIN_D5) // F Vypinac chodba 2.n.p. vychod |
69 |
#define IS201AV input(PIN_D5) // F Vypinac chodba 2.n.p. vychod |
62 |
#define IS209AJ input(PIN_D6) // G Vypinac koupelna Zizala |
70 |
#define IS209AJ input(PIN_D6) // G Vypinac koupelna Zizala |
63 |
#define IS203AJ input(PIN_D7) // H Vypinac koupelna Kaklik |
71 |
#define IS203AJ input(PIN_D7) // H Vypinac koupelna Kaklik |
64 |
|
72 |
|
65 |
#define OS102A PIN_E0 // t1 Svetlo chodba |
73 |
#define OS102A PIN_E0 // t1 Svetlo chodba |
Line 200... |
Line 208... |
200 |
tr110N=0; |
208 |
tr110N=0; |
201 |
tr104V=0; |
209 |
tr104V=0; |
202 |
tr104J=0; |
210 |
tr104J=0; |
203 |
tr207V=0; |
211 |
tr207V=0; |
204 |
|
212 |
|
- |
|
213 |
{ |
- |
|
214 |
int n; |
- |
|
215 |
|
- |
|
216 |
for(n=0;n<10;n++) |
- |
|
217 |
{ |
205 |
output_high(LED1); // Indikace restartu (pockame na nabiti kondenzatoru ve vstupnich obvodech) |
218 |
output_low(LED1); // Indikace restartu (pockame na nabiti kondenzatoru ve vstupnich obvodech) |
206 |
delay_ms(100); |
219 |
delay_ms(100); |
207 |
output_low(LED1); |
- |
|
208 |
delay_ms(30); |
- |
|
209 |
output_high(LED1); |
220 |
output_high(LED1); |
210 |
restart_wdt(); |
- |
|
211 |
delay_ms(100); |
221 |
delay_ms(100); |
212 |
output_low(LED1); |
- |
|
213 |
delay_ms(30); |
- |
|
214 |
output_high(LED1); |
- |
|
215 |
restart_wdt(); |
222 |
restart_wdt(); |
- |
|
223 |
} |
- |
|
224 |
} |
216 |
|
225 |
|
217 |
s201AV=IS201AV; // Precteme vychozi stav vypinacu |
226 |
s201AV=IS201AV; // Precteme vychozi stav vypinacu |
218 |
s201AZ=IS201AZ; |
227 |
s201AZ=IS201AZ; |
219 |
s207AJ=IS207AJ; |
228 |
s207AJ=IS207AJ; |
220 |
s203AJ=IS203AJ; |
229 |
s203AJ=IS203AJ; |
221 |
s209AJ=IS209AJ; |
230 |
s209AJ=IS209AJ; |
222 |
r207VU=IR207VU; |
231 |
r207VU=IR207VU; |
223 |
r207VD=IR207VD; |
232 |
r207VD=IR207VD; |
224 |
|
233 |
|
- |
|
234 |
CREN=0; CREN=1; // Reinitialise USART |
- |
|
235 |
|
225 |
enable_interrupts(INT_TIMER0); |
236 |
enable_interrupts(INT_TIMER0); |
226 |
enable_interrupts(GLOBAL); |
237 |
enable_interrupts(GLOBAL); |
227 |
|
238 |
|
228 |
CREN=0; CREN=1; // Reinitialise USART |
- |
|
229 |
|
- |
|
230 |
while(TRUE) |
239 |
while(TRUE) |
231 |
{ |
240 |
{ |
232 |
|
241 |
|
233 |
if(kbhit()) // Chce po nas nekdo neco? |
242 |
if(kbhit()) // Chce po nas nekdo neco? |
234 |
{ |
243 |
{ |