129 |
kapl |
1 |
#include "main.h" |
|
|
2 |
|
|
|
3 |
#define LCD_RS PIN_B1 // rizeni registru LCD displeje |
|
|
4 |
#define LCD_E PIN_B0 // enable LCD displeje |
|
|
5 |
#define LCD_DATA_LSB PIN_C0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou) |
|
|
6 |
|
|
|
7 |
#include "lcd.c" |
|
|
8 |
|
|
|
9 |
void main() |
|
|
10 |
{ |
|
|
11 |
char odp1[45]; |
|
|
12 |
char odp2[10]; |
|
|
13 |
char odp3[45]; |
|
|
14 |
char odp4[10]; |
|
|
15 |
char odp5[45]; |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
setup_adc_ports(NO_ANALOGS); |
|
|
20 |
setup_adc(ADC_OFF); |
|
|
21 |
setup_psp(PSP_DISABLED); |
|
|
22 |
setup_spi(FALSE); |
|
|
23 |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
24 |
setup_timer_1(T1_DISABLED); |
|
|
25 |
setup_timer_2(T2_DISABLED,0,1); |
|
|
26 |
|
|
|
27 |
lcd_init(); |
|
|
28 |
|
|
|
29 |
delay_ms(2000); |
|
|
30 |
|
|
|
31 |
printf(lcd_putc,"\f Z"); |
|
|
32 |
delay_ms(100); |
|
|
33 |
printf(lcd_putc,"a"); |
|
|
34 |
delay_ms(50); |
|
|
35 |
printf(lcd_putc,"v"); |
|
|
36 |
delay_ms(50); |
|
|
37 |
printf(lcd_putc,"a"); |
|
|
38 |
delay_ms(50); |
|
|
39 |
printf(lcd_putc,"d"); |
|
|
40 |
delay_ms(50); |
|
|
41 |
printf(lcd_putc,"i"); |
|
|
42 |
delay_ms(50); |
|
|
43 |
printf(lcd_putc,"m"); |
|
|
44 |
delay_ms(50); |
|
|
45 |
printf(lcd_putc," "); |
|
|
46 |
delay_ms(50); |
|
|
47 |
printf(lcd_putc,"s"); |
|
|
48 |
delay_ms(50); |
|
|
49 |
printf(lcd_putc,"y"); |
|
|
50 |
delay_ms(50); |
|
|
51 |
printf(lcd_putc,"s"); |
|
|
52 |
delay_ms(50); |
|
|
53 |
printf(lcd_putc,"t"); |
|
|
54 |
delay_ms(50); |
|
|
55 |
printf(lcd_putc,"e"); |
|
|
56 |
delay_ms(50); |
|
|
57 |
printf(lcd_putc,"m\n"); |
|
|
58 |
delay_ms(150); |
|
|
59 |
printf(lcd_putc," ."); |
|
|
60 |
delay_ms(150); |
|
|
61 |
printf(lcd_putc," ."); |
|
|
62 |
delay_ms(175); |
|
|
63 |
printf(lcd_putc," ."); |
|
|
64 |
delay_ms(300); |
|
|
65 |
printf(lcd_putc," ."); |
|
|
66 |
delay_ms(400); |
|
|
67 |
printf(lcd_putc," ."); |
|
|
68 |
delay_ms(550); |
|
|
69 |
|
|
|
70 |
while(true) |
|
|
71 |
{ |
|
|
72 |
output_low(PIN_A4); |
|
|
73 |
delay_ms(1500); |
|
|
74 |
output_high(PIN_A4); |
|
|
75 |
|
|
|
76 |
printf("AT+CBC\r"); |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
gets(odp1); |
|
|
80 |
gets(odp2); |
|
|
81 |
gets(odp3); |
|
|
82 |
gets(odp4); |
|
|
83 |
gets(odp5); |
|
|
84 |
|
|
|
85 |
|
|
|
86 |
printf(lcd_putc,"\fODP1:%s",odp1); |
|
|
87 |
delay_ms(2000); |
|
|
88 |
|
|
|
89 |
printf(lcd_putc,"\fODP2:%s",odp2); |
|
|
90 |
delay_ms(2000); |
|
|
91 |
|
|
|
92 |
printf(lcd_putc,"\fODP3:%s",odp3); |
|
|
93 |
delay_ms(2000); |
|
|
94 |
|
|
|
95 |
printf(lcd_putc,"\fODP4:%s",odp4); |
|
|
96 |
delay_ms(2000); |
|
|
97 |
|
|
|
98 |
printf(lcd_putc,"\fODP5:%s",odp5); |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
output_low(PIN_A4); |
|
|
102 |
delay_ms(150); |
|
|
103 |
output_high(PIN_A4); |
|
|
104 |
delay_ms(100); |
|
|
105 |
output_low(PIN_A4); |
|
|
106 |
delay_ms(150); |
|
|
107 |
output_high(PIN_A4); |
|
|
108 |
delay_ms(100); |
|
|
109 |
output_low(PIN_A4); |
|
|
110 |
delay_ms(150); |
|
|
111 |
output_high(PIN_A4); |
|
|
112 |
delay_ms(1500); |
|
|
113 |
} |
|
|
114 |
} |