<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 數(shù)碼管動態(tài)顯示1——7,循環(huán)右移

          數(shù)碼管動態(tài)顯示1——7,循環(huán)右移

          作者: 時間:2016-11-20 來源:網(wǎng)絡(luò) 收藏
          數(shù)碼管動態(tài)顯示1——7,循環(huán)右移

          * 功 能:數(shù)碼管動態(tài)顯示1——7,循環(huán)右移 *
          * 芯片:Amega16L *
          * 時鐘頻率:內(nèi)部4M *
          * 編譯環(huán)境:ICC-AVR7 *



          #include
          #include

          #define uint unsigned int
          #define uchar unsigned char
          #define on_138 PORTC|=BIT(PC7) //on or off 138
          #define off_138 PORTC&=~BIT(PC7)
          #pragma data:code

          uchar flash table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; //the data for display
          uchar flash site[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07};

          void delay(uint ms)
          {
          uint i,j;
          for(i=0;i for(j=0;j<1141;j++);
          }

          void display(uint i, uint j)
          {
          PORTB=table[j];
          PORTA=site[i];
          delay(1);
          }

          void main()
          {
          int i,j,k,m;
          DDRA=0XFF;
          DDRB=0XFF;
          DDRC=0X80;
          on_138;
          while(1)
          {

          for(i=0;i<8;i++)
          {
          for(m=0;m<60;m++)
          {
          for(j=i;j<8;j++)
          {
          display(j,j-i);
          }
          for(j=0;j {
          display(j,j+8-i);
          }
          }

          }
          }
          }


          評論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();