From 066d3681f5e006f6c83d3564eaeeaf07e130811d Mon Sep 17 00:00:00 2001 From: fengbh <1953356163@qq.com> Date: Mon, 15 Jul 2024 02:58:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=9C=82=E9=B8=A3=E5=99=A8?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/public.h | 1 + src/main.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/public.h b/include/public.h index 395bbd3..6035300 100644 --- a/include/public.h +++ b/include/public.h @@ -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); diff --git a/src/main.c b/src/main.c index 690465c..380fa93 100644 --- a/src/main.c +++ b/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"); } }