|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区
您需要 登录 才可以下载或查看,没有账号?立即注册
×
//红色LED亮
//蜂鸣器响
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit d0=P1^7;
sbit BEEP=P1^6;
void delay(uchar dly)
{
uchar i,j;
for(i=255;i>0;i--)
for(j=dly;j>0;j--);
}
void main()
{
while(1)
{
d0=1;
BEEP=0;
delay(255);
d0=0;
BEEP=1;
delay(255);
}
} |
|