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

從低位到高位流動(dòng)的閃爍燈

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

 #include<reg51.h>
 #include<intrins.h>
 #define  uint unsigned int
 #define  uchar unsigned char
 void delay(uint x )
 {
   uint i,j;
   for(i=x;i>0;i--)
    for(j=110;j>0;j--);
 }
 void main()
 
    P0=0xfe;
    while(1)
 {
     P0=_crol_(P0,1);
  delay(100);
 }
  }
關(guān)閉窗口

相關(guān)文章