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," system\n"); |
|
|
46 |
delay_ms(150); |
|
|
47 |
printf(lcd_putc," ."); |
|
|
48 |
delay_ms(150); |
|
|
49 |
printf(lcd_putc," ."); |
|
|
50 |
delay_ms(175); |
|
|
51 |
printf(lcd_putc," ."); |
|
|
52 |
delay_ms(300); |
|
|
53 |
printf(lcd_putc," ."); |
|
|
54 |
delay_ms(400); |
|
|
55 |
printf(lcd_putc," ."); |
|
|
56 |
delay_ms(550); |
|
|
57 |
|
|
|
58 |
while(true) |
|
|
59 |
{ |
|
|
60 |
output_low(PIN_A4); |
|
|
61 |
delay_ms(1500); |
|
|
62 |
output_high(PIN_A4); |
|
|
63 |
|
|
|
64 |
printf("AT+CBC\r"); |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
gets(odp1); |
|
|
68 |
gets(odp2); |
|
|
69 |
gets(odp3); |
|
|
70 |
gets(odp4); |
|
|
71 |
gets(odp5); |
|
|
72 |
|
|
|
73 |
|
|
|
74 |
printf(lcd_putc,"\fODP1:%s",odp1); |
|
|
75 |
delay_ms(2000); |
|
|
76 |
|
|
|
77 |
printf(lcd_putc,"\fODP2:%s",odp2); |
|
|
78 |
delay_ms(2000); |
|
|
79 |
|
|
|
80 |
printf(lcd_putc,"\fODP3:%s",odp3); |
|
|
81 |
delay_ms(2000); |
|
|
82 |
|
|
|
83 |
printf(lcd_putc,"\fODP4:%s",odp4); |
|
|
84 |
delay_ms(2000); |
|
|
85 |
|
|
|
86 |
printf(lcd_putc,"\fODP5:%s",odp5); |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
output_low(PIN_A4); |
|
|
90 |
delay_ms(150); |
|
|
91 |
output_high(PIN_A4); |
|
|
92 |
delay_ms(100); |
|
|
93 |
output_low(PIN_A4); |
|
|
94 |
delay_ms(150); |
|
|
95 |
output_high(PIN_A4); |
|
|
96 |
delay_ms(100); |
|
|
97 |
output_low(PIN_A4); |
|
|
98 |
delay_ms(150); |
|
|
99 |
output_high(PIN_A4); |
|
|
100 |
delay_ms(1500); |
|
|
101 |
} |
|
|
102 |
} |