Line 4... |
Line 4... |
4 |
#define MAX_SLOVO 10 // Maximalni pocet znaku ve slovu |
4 |
#define MAX_SLOVO 10 // Maximalni pocet znaku ve slovu |
5 |
|
5 |
|
6 |
int8 napis[MAX_SLOVO+1]; |
6 |
int8 napis[MAX_SLOVO+1]; |
7 |
int8 otacky; |
7 |
int8 otacky; |
8 |
|
8 |
|
9 |
const int8 logo[MAX_SLOVO+1]={'[','c','a','a','e',']','c','a','a','i',0}; // 2004-2008 |
9 |
const int8 logo[MAX_SLOVO+1]={'[','[',92,'[','E','e','A','[',92,'[',0}; // [blesk] E4A [blesk] |
10 |
const int8 rok[MAX_SLOVO+1]={'[','[',92,'[','E','e','A','[',92,'[',0}; // [blesk] E4A [blesk] |
10 |
const int8 rok[MAX_SLOVO+1]={'[','c','a','a','e',']','c','a','a','i',0}; // 2004-2008 |
11 |
|
11 |
|
12 |
#int_RDA |
12 |
#int_RDA |
13 |
void RDA_isr(void) |
13 |
void RDA_isr(void) |
14 |
{ |
14 |
{ |
15 |
int n; |
15 |
int n; |
16 |
output_B(0x55); |
16 |
output_B(0x55); |
17 |
for(n=0;n<MAX_SLOVO;n++) |
17 |
for(n=0;n<MAX_SLOVO;n++) |
18 |
{ |
18 |
{ |
19 |
napis[n]=getc(); |
19 |
napis[n]=getc(); |
20 |
} |
20 |
} |
- |
|
21 |
otacky=0; |
21 |
} |
22 |
} |
22 |
|
23 |
|
23 |
void LED_print() |
24 |
void LED_print() |
24 |
{ |
25 |
{ |
25 |
unsigned int slovo,pismeno,sloupec,j; |
26 |
unsigned int slovo,pismeno,sloupec,j; |
26 |
3 |
27 |
|
27 |
const int8 pis[45*5]={0b00000001,0b11110110,0b11110110,0b11110110,0b00000001, // A |
28 |
const int8 pis[45*5]={0b00000001,0b11110110,0b11110110,0b11110110,0b00000001, // A |
28 |
0b00000000,0b01110110,0b01110110,0b01110110,0b10001001, // B |
29 |
0b00000000,0b01110110,0b01110110,0b01110110,0b10001001, // B |
29 |
0b10000001,0b01111110,0b01111110,0b01111110,0b10111101, // C |
30 |
0b10000001,0b01111110,0b01111110,0b01111110,0b10111101, // C |
30 |
0b00000000,0b01111110,0b01111110,0b01111110,0b10000001, // D |
31 |
0b00000000,0b01111110,0b01111110,0b01111110,0b10000001, // D |
31 |
0b00000000,0b01110110,0b01110110,0b01111110,0b01111110, // E |
32 |
0b00000000,0b01110110,0b01110110,0b01111110,0b01111110, // E |
Line 66... |
Line 67... |
66 |
0b11111110,0b11111110,0b00001110,0b11110110,0b11111000, // 7 h |
67 |
0b11111110,0b11111110,0b00001110,0b11110110,0b11111000, // 7 h |
67 |
0b10001001,0b01110110,0b01110110,0b01110110,0b10001001, // 8 i |
68 |
0b10001001,0b01110110,0b01110110,0b01110110,0b10001001, // 8 i |
68 |
0b10111001,0b01110110,0b01110110,0b01110110,0b10000001, // 9 j |
69 |
0b10111001,0b01110110,0b01110110,0b01110110,0b10000001, // 9 j |
69 |
0b11111111,0b01111110,0b10111101,0b11000011,0b11111111, // ) k |
70 |
0b11111111,0b01111110,0b10111101,0b11000011,0b11111111, // ) k |
70 |
0b11111111,0b11000011,0b10111101,0b01111110,0b11111111, // ( l |
71 |
0b11111111,0b11000011,0b10111101,0b01111110,0b11111111, // ( l |
71 |
0b11111111,0b11111111,0b11111111,0b11011011,0b11111111, // : m |
72 |
0b11111111,0b11111111,0b11111111,0b11011011,0b11111111, // : m |
72 |
}; |
73 |
}; |
73 |
|
- |
|
- |
|
74 |
|
74 |
while(read_adc()<9); // Cekani na magnet |
75 |
while(read_adc()<9); // Cekani na magnet |
75 |
delay_ms(10); |
76 |
while(read_adc()>50); // Cekani na opusteni magnetu |
- |
|
77 |
delay_ms(7); //cekani, na dostatecni odstup od magnetu, pred zacatkem psani textu |
76 |
|
78 |
|
77 |
for(pismeno=0;pismeno<MAX_SLOVO;pismeno++) |
79 |
for(pismeno=0;pismeno<MAX_SLOVO;pismeno++) |
78 |
{ |
80 |
{ |
79 |
for(sloupec=0;sloupec<5;sloupec++) |
81 |
for(sloupec=0;sloupec<5;sloupec++) |
80 |
{ |
82 |
{ |
Line 110... |
Line 112... |
110 |
otacky=0; |
112 |
otacky=0; |
111 |
napis[0]=0; |
113 |
napis[0]=0; |
112 |
|
114 |
|
113 |
while(TRUE) |
115 |
while(TRUE) |
114 |
{ |
116 |
{ |
- |
|
117 |
int1 vyber; |
- |
|
118 |
|
- |
|
119 |
otacky++; |
- |
|
120 |
|
115 |
if (napis[0]!=0) |
121 |
if (napis[0]!=0 && otacky <= 30) |
116 |
{ |
122 |
{ |
117 |
LED_print(); |
123 |
LED_print(); |
118 |
} |
124 |
} |
119 |
else |
125 |
else |
120 |
{ |
126 |
{ |
- |
|
127 |
if (vyber == 0) strcpy(napis,logo); |
121 |
strcpy(napis,logo); |
128 |
else strcpy(napis,rok); |
- |
|
129 |
vyber++; |
122 |
} |
130 |
} |
123 |
} |
131 |
} |
124 |
} |
132 |
} |