專注電子技術(shù)學(xué)習(xí)與研究
當(dāng)前位置:單片機(jī)教程網(wǎng) >> MCU設(shè)計(jì)實(shí)例 >> 瀏覽文章

讓led燈閃爍

作者:huqin   來源:本站原創(chuàng)   點(diǎn)擊數(shù):  更新時(shí)間:2014年04月26日   【字體:

 

#include<reg51.h>
 #define  uint unsigned int
 #define  uchar unsigned char
sbit en=P1^0;


 void delay(uint x )
 {
   uint i,j;
   for(i=x;i>0;i--)
    for(j=110;j>0;j--);
 }
 void main()
 
 
    while(1)
 {
   en=~en;
   delay(15);
 }
  }

關(guān)閉窗口

相關(guān)文章