background image

单片机 C 语言程序设计实训 100

——

基于 8051+Proteus 仿真

入门资料~~~~

单片机 语言程序设计实训 100 

——基于 8051+ Proteus 仿真

01 闪烁的

 

LED 

/*  

 

名称:闪烁的

 

LED 

说明:LED

 

 

按设定的时间间隔闪烁 */ 

#include<reg51.h> 

#define uchar unsigned char 

#define uint unsigned int 

sbit LED=P10; 

//

 

延时

void DelayMS(uint x) 

uchar i; 

while(x--) 

for(i=0;i<120;i++); 

}

 //

 

主程序

void main() 

while(1) 

                                 

陈文亚

1