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 |
{ |
125 |
kaklik |
11 |
char odp[10]; |
124 |
kapl |
12 |
|
|
|
13 |
setup_adc_ports(NO_ANALOGS); |
|
|
14 |
setup_adc(ADC_OFF); |
|
|
15 |
setup_psp(PSP_DISABLED); |
|
|
16 |
setup_spi(FALSE); |
|
|
17 |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
18 |
setup_timer_1(T1_DISABLED); |
|
|
19 |
setup_timer_2(T2_DISABLED,0,1); |
|
|
20 |
|
|
|
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"); |
125 |
kaklik |
31 |
odp[0]=getc(); |
|
|
32 |
odp[1]=0; |
|
|
33 |
|
|
|
34 |
printf(lcd_putc,"ble:%s\n\r",odp); |
124 |
kapl |
35 |
|
|
|
36 |
} |
|
|
37 |
} |