Line 7... |
Line 7... |
7 |
#define LCD_DATA5 PIN_D5 //// |
7 |
#define LCD_DATA5 PIN_D5 //// |
8 |
#define LCD_DATA6 PIN_D6 //// |
8 |
#define LCD_DATA6 PIN_D6 //// |
9 |
#define LCD_DATA7 PIN_D7 |
9 |
#define LCD_DATA7 PIN_D7 |
10 |
#include <lcd.c> |
10 |
#include <lcd.c> |
11 |
|
11 |
|
- |
|
12 |
#define BEEPER PIN_B5 |
- |
|
13 |
|
- |
|
14 |
int beep() |
- |
|
15 |
{ |
- |
|
16 |
unsigned int i; |
- |
|
17 |
|
- |
|
18 |
i=0; |
- |
|
19 |
for(i=0;i<100;i++) |
- |
|
20 |
{ |
- |
|
21 |
output_low(BEEPER); |
- |
|
22 |
delay_ms(1); |
- |
|
23 |
output_high(BEEPER); |
- |
|
24 |
delay_ms(1); |
- |
|
25 |
} |
- |
|
26 |
} |
- |
|
27 |
|
- |
|
28 |
|
12 |
void main() |
29 |
void main() |
13 |
{ |
30 |
{ |
14 |
int16 i=0; |
31 |
int16 i=0; |
15 |
|
32 |
|
16 |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
33 |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
Line 36... |
Line 53... |
36 |
|
53 |
|
37 |
printf(lcd_putc,"LCD test"); |
54 |
printf(lcd_putc,"LCD test"); |
38 |
lcd_gotoxy(1,2); |
55 |
lcd_gotoxy(1,2); |
39 |
printf(lcd_putc,"%c %x ",i,i); |
56 |
printf(lcd_putc,"%c %x ",i,i); |
40 |
i++; |
57 |
i++; |
41 |
|
58 |
beep(); |
42 |
Delay_ms(500); |
59 |
Delay_ms(500); |
43 |
} |
60 |
} |
44 |
|
61 |
|
45 |
} |
62 |
} |