#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit LED=P1^1;
//延时
void DelayMS(uint x)
{
uchar i;
while(x--)
{
for(i=0;i<120;i++);
}
}
//主程序
void main()
{
while(1)
{
LED=~LED;
DelayMS(150);
}
}
基于51单片机的闪烁灯程序
4星 · 超过85%的资源 86 浏览量
2011-11-15
17:33:11
上传
评论 1
收藏 36KB ZIP 举报
he1107he
- 粉丝: 0
- 资源: 6