124 |
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 |
|
|
|
12 |
setup_adc_ports(NO_ANALOGS); |
|
|
13 |
setup_adc(ADC_OFF); |
|
|
14 |
setup_psp(PSP_DISABLED); |
|
|
15 |
setup_spi(FALSE); |
|
|
16 |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
17 |
setup_timer_1(T1_DISABLED); |
|
|
18 |
setup_timer_2(T2_DISABLED,0,1); |
|
|
19 |
|
|
|
20 |
char odp[]; |
|
|
21 |
lcd_init(); |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
while(true) |
|
|
25 |
{ |
|
|
26 |
output_low(PIN_A4); |
|
|
27 |
delay_ms(1500); |
|
|
28 |
output_high(PIN_A4); |
|
|
29 |
|
|
|
30 |
printf("AT\r"); |
|
|
31 |
odp=getc(); |
|
|
32 |
|
|
|
33 |
printf(lcd_putc,"\f%c",odp); |
|
|
34 |
|
|
|
35 |
} |
|
|
36 |
} |