221 |
svejda |
1 |
#include "C:\RS\Prog\finalni\main.h" |
|
|
2 |
|
|
|
3 |
|
|
|
4 |
void main() |
|
|
5 |
{ |
|
|
6 |
int cas; |
|
|
7 |
int8 hall; |
|
|
8 |
|
|
|
9 |
const int8 A[7]={0b00000001,0b11110110,0b11110110,0b11110110,0b00000001,0b11111111,0b11111111}; |
|
|
10 |
const int8 B[7]={0b00000000,0b01110110,0b01110110,0b01110110,0b10001001,0b11111111,0b11111111}; |
|
|
11 |
const int8 C[7]={0b10000001,0b01111110,0b01111110,0b01111110,0b10111101,0b11111111,0b11111111}; |
|
|
12 |
const int8 D[7]={0b00000000,0b01111110,0b01111110,0b01111110,0b10000001,0b11111111,0b11111111}; |
|
|
13 |
const int8 E[7]={0b00000000,0b01110110,0b01110110,0b01111110,0b01111110,0b11111111,0b11111111}; |
|
|
14 |
const int8 F[7]={0b00000000,0b11110110,0b11110110,0b11111110,0b11111110,0b11111111,0b11111111}; |
|
|
15 |
const int8 G[7]={0b10000001,0b01111110,0b01110110,0b01110110,0b10000101,0b11111111,0b11111111}; |
|
|
16 |
const int8 H[7]={0b00000000,0b11110111,0b11110111,0b11110111,0b00000000,0b11111111,0b11111111}; |
|
|
17 |
const int8 I[7]={0b01111110,0b01111110,0b00000000,0b01111110,0b01111110,0b11111111,0b11111111}; |
|
|
18 |
const int8 J[7]={0b10111110,0b01111110,0b01111110,0b01111110,0b10000000,0b11111111,0b11111111}; |
|
|
19 |
const int8 K[7]={0b00000000,0b11110111,0b11110111,0b11101011,0b00011100,0b11111111,0b11111111}; |
|
|
20 |
const int8 L[7]={0b00000000,0b01111111,0b01111111,0b01111111,0b01111111,0b11111111,0b11111111}; |
|
|
21 |
const int8 M[7]={0b00000000,0b11111110,0b11110000,0b11111110,0b00000000,0b11111111,0b11111111}; |
|
|
22 |
const int8 N[7]={0b00000000,0b11101111,0b11011111,0b10111111,0b00000000,0b11111111,0b11111111}; |
|
|
23 |
const int8 O[7]={0b10000001,0b01111110,0b01111110,0b01111110,0b10000001,0b11111111,0b11111111}; |
|
|
24 |
const int8 P[7]={0b00000000,0b11110110,0b11110110,0b11110110,0b11111001,0b11111111,0b11111111}; |
|
|
25 |
const int8 Q[7]={0b10000001,0b01111110,0b01111110,0b01111110,0b00000001,0b01111111,0b11111111}; |
|
|
26 |
const int8 R[7]={0b00000000,0b11110110,0b11110110,0b11110110,0b00001001,0b11111111,0b11111111}; |
|
|
27 |
const int8 S[7]={0b10111001,0b01110110,0b01110110,0b01110110,0b10001101,0b11111111,0b11111111}; |
|
|
28 |
const int8 T[7]={0b11111110,0b11111110,0b00000000,0b11111110,0b11111110,0b11111111,0b11111111}; |
|
|
29 |
const int8 U[7]={0b10000000,0b01111111,0b01111111,0b01111111,0b10000000,0b11111111,0b11111111}; |
|
|
30 |
const int8 V[7]={0b11000000,0b10111111,0b01111111,0b10111111,0b11000000,0b11111111,0b11111111}; |
|
|
31 |
const int8 W[7]={0b10000000,0b01111111,0b10000000,0b01111111,0b10000000,0b11111111,0b11111111}; |
|
|
32 |
const int8 X[7]={0b00011100,0b11101011,0b11110111,0b11101011,0b00011100,0b11111111,0b11111111}; |
|
|
33 |
const int8 Y[7]={0b11111000,0b11110111,0b00000111,0b11110111,0b11111000,0b11111111,0b11111111}; |
|
|
34 |
const int8 Z[7]={0b00011110,0b01101110,0b01110110,0b01111010,0b01111100,0b11111111,0b11111111}; |
|
|
35 |
const int8 null [7]={0b00000000,0b01111110,0b01111110,0b01111110,0b00000000,0b11111111,0b11111111}; |
|
|
36 |
const int8 one [7]={0b01111011,0b01111101,0b00000000,0b01111111,0b01111111,0b11111111,0b11111111}; |
|
|
37 |
const int8 two [7]={0b00111101,0b01011110,0b01101110,0b01110110,0b01111001,0b11111111,0b11111111}; |
|
|
38 |
const int8 three[7]={0b10111101,0b01111110,0b01110110,0b01110110,0b10001001,0b11111111,0b11111111}; |
|
|
39 |
const int8 four [7]={0b11110000,0b11110111,0b11110111,0b00000001,0b11110111,0b11111111,0b11111111}; |
|
|
40 |
const int8 five [7]={0b10111000,0b01110110,0b01110110,0b01110110,0b10001110,0b11111111,0b11111111}; |
|
|
41 |
const int8 six [7]={0b10000001,0b01110110,0b01110110,0b01110110,0b10001101,0b11111111,0b11111111}; |
|
|
42 |
const int8 seven[7]={0b11111110,0b11111110,0b00001110,0b11110110,0b11111000,0b11111111,0b11111111}; |
|
|
43 |
const int8 eight[7]={0b10001001,0b01110110,0b01110110,0b01110110,0b10001001,0b11111111,0b11111111}; |
|
|
44 |
const int8 nine [7]={0b10111001,0b01110110,0b01110110,0b01110110,0b10000001,0b11111111,0b11111111}; |
|
|
45 |
|
|
|
46 |
const int8 mezera[7]={0b11111111,0b11111111,0b11111111,0b11111111,0b11111111,0b11111111,0b11111111}; |
|
|
47 |
|
|
|
48 |
setup_adc_ports(AN0); |
|
|
49 |
setup_adc(ADC_CLOCK_DIV_8); |
|
|
50 |
setup_psp(PSP_DISABLED); |
|
|
51 |
setup_spi(SPI_SS_DISABLED); |
|
|
52 |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
53 |
setup_timer_1(T1_DISABLED); |
|
|
54 |
setup_timer_2(T2_DISABLED,0,1); |
|
|
55 |
setup_comparator(NC_NC_NC_NC); |
|
|
56 |
setup_vref(FALSE); |
|
|
57 |
|
|
|
58 |
set_adc_channel(0); |
|
|
59 |
delay_us(10); |
|
|
60 |
|
|
|
61 |
while(TRUE) |
|
|
62 |
{ |
|
|
63 |
hall=read_adc(); |
|
|
64 |
if(hall>10) |
|
|
65 |
{ |
|
|
66 |
|
|
|
67 |
for(cas=0;cas<7;cas++) |
|
|
68 |
{ |
|
|
69 |
output_B(L[cas]); |
|
|
70 |
delay_ms(1); |
|
|
71 |
} |
|
|
72 |
for(cas=0;cas<7;cas++) |
|
|
73 |
{ |
|
|
74 |
output_B(E[cas]); |
|
|
75 |
delay_ms(1); |
|
|
76 |
} |
|
|
77 |
for(cas=0;cas<7;cas++) |
|
|
78 |
{ |
|
|
79 |
output_B(D[cas]); |
|
|
80 |
delay_ms(1); |
|
|
81 |
} |
|
|
82 |
for(cas=0;cas<7;cas++) |
|
|
83 |
{ |
|
|
84 |
output_B(mezera[cas]); |
|
|
85 |
delay_ms(1); |
|
|
86 |
} |
|
|
87 |
for(cas=0;cas<7;cas++) |
|
|
88 |
{ |
|
|
89 |
output_B(E[cas]); |
|
|
90 |
delay_ms(1); |
|
|
91 |
} |
|
|
92 |
for(cas=0;cas<7;cas++) |
|
|
93 |
{ |
|
|
94 |
output_B(F[cas]); |
|
|
95 |
delay_ms(1); |
|
|
96 |
} |
|
|
97 |
for(cas=0;cas<7;cas++) |
|
|
98 |
{ |
|
|
99 |
output_B(F[cas]); |
|
|
100 |
delay_ms(1); |
|
|
101 |
} |
|
|
102 |
for(cas=0;cas<7;cas++) |
|
|
103 |
{ |
|
|
104 |
output_B(E[cas]); |
|
|
105 |
delay_ms(1); |
|
|
106 |
} |
|
|
107 |
for(cas=0;cas<7;cas++) |
|
|
108 |
{ |
|
|
109 |
output_B(C[cas]); |
|
|
110 |
delay_ms(1); |
|
|
111 |
} |
|
|
112 |
for(cas=0;cas<7;cas++) |
|
|
113 |
{ |
|
|
114 |
output_B(T[cas]); |
|
|
115 |
delay_ms(1); |
|
|
116 |
} |
|
|
117 |
|
|
|
118 |
} |
|
|
119 |
} |
|
|
120 |
} |