- 博客(0)
- 资源 (1)
- 收藏
- 关注
用protues画单片机51
protues来画51单片机第 01 篇 基础程序设计
01 闪烁的LED
/* 名称:闪烁的LED
说明:LED按设定的时间间隔闪烁
*/
#include<reg51.h>
#define uchar unsigned char
#define uint unsigned int
sbit LED=P1^0;
//延时
void DelayMS(uint x)
{
uchar i;
while(x--)
{
for(i=0;i<120;i++);
}
}
//主程序
void main()
{
LED=0;
while(1)
{
LED=~LED;
DelayMS(150);
}
}
2012-03-02
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人