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

          新聞中心

          單片機(jī)LED數(shù)碼管

          作者: 時(shí)間:2016-11-21 來(lái)源:網(wǎng)絡(luò) 收藏
          電路圖:

          代碼如下:
          #include
          char led_mod[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f }; //LED 0 - 9
          void delay(unsigned int time) {
          unsigned int j = 0;
          for(; time > 0; time--)
          for(j = 0; j < 125; j++);
          }
          void main(void) {
          char i = 0, j =0 ;
          P0 = P2 = led_mod[0];
          while (1) {
          for(i = 0; i <= 9; i++) {
          P0 = led_mod[i];
          //delay(500);
          for(j = 0; j <=9; j++){
          P2 = led_mod[j];
          delay(800);
          }
          P2 = led_mod[0];
          }
          }
          }



          關(guān)鍵詞: 單片機(jī)LED數(shù)碼

          評(píng)論


          技術(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); })();