增加蜂鸣器函数
This commit is contained in:
parent
1da2d22ee8
commit
066d3681f5
@ -13,6 +13,7 @@ __sfr __at (0xE7) ISP_CONTR;
|
||||
extern char __xdata reset_password[RESET_PASSWORD_LENGTH];
|
||||
extern char __xdata receice_password[RESET_PASSWORD_LENGTH];
|
||||
|
||||
#define BEEP P2_5
|
||||
|
||||
void delay_10us(u16 ten_us);
|
||||
void delay_ms(u16 ms);
|
||||
|
11
src/main.c
11
src/main.c
@ -33,11 +33,14 @@ void main(void)
|
||||
// led_all_off();
|
||||
// delay_ms(1000);
|
||||
// 实验二:流水灯
|
||||
LED = ~i;
|
||||
i = rotate_left(i,1);
|
||||
delay_ms(1000);
|
||||
// LED = ~i;
|
||||
// i = rotate_left(i,1);
|
||||
// delay_ms(1000);
|
||||
// 实验三:蜂鸣器
|
||||
BEEP=!BEEP;
|
||||
delay_10us(100);
|
||||
|
||||
printf("Hello,world!\r\n");
|
||||
// printf("Hello,world!\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user