#include <reg52.h>
#include <intrins.h>
typedef unsigned char u8;
typedef unsigned int u16;
u16 i;
sbit beep=P1^5;
void delay(u16 i)
{
while(i--);
}
void main()
{
while(1)
{
i=300;
delay(5000);
while(i)
{
i=i-1;
beep=0;
delay(10);
beep=1;
delay(10);
beep=0;
delay(5);
beep=1;
delay(5);
}}
}
(3)单片机蜂鸣器
最新推荐文章于 2024-04-27 14:41:20 发布