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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 51單片機驅(qū)動16*16點陣顯示生日快樂程序

          51單片機驅(qū)動16*16點陣顯示生日快樂程序

          作者: 時間:2016-11-30 來源:網(wǎng)絡(luò) 收藏

          Delayms(uint c)
          {
          uint a,b;
          for(a=0;a for(b=0;b<120;b++);
          }
          void write(uchar com,uchar da)
          {
          uchar temp,i,j;
          load=0;
          clk=0;
          for(i=0;i<8;i++)
          { temp=com;
          if((temp&(0x80>>i))!=0)
          din=1;
          else din=0;
          clk=1;
          for(j=0;j<5;j++);
          clk=0;
          }
          for(i=0;i<8;i++)
          { temp=da;
          if((temp&(0x80>>i))!=0)
          din=1;
          else din=0;
          clk=1;
          for(j=0;j<5;j++);
          clk=0;
          }
          load=1;

          本文引用地址:http://www.ex-cimer.com/article/201611/323745.htm

          }

          void main()

          {

          csh();
          write(0x0c,0x01);//正常工作狀態(tài),關(guān)斷模式
          write(0x09,0x00);//譯碼選擇,非BCD碼
          write(0x0a,0x0a);//亮度調(diào)節(jié)
          write(0x0b,0x07);//顯示位數(shù)
          Initial_DS1302();
          while(1)
          {
          DS1302_GetTime(&time1);
          buf[7]=(time1.Second)%10;
          buf[6]=(time1.Second)/10;
          buf[4]=(time1.Minute)%10;
          buf[3]=(time1.Minute)/10;
          buf[1]=(time1.Hour)%10;
          buf[0]=(time1.Hour)/10;
          write(0x08,dispcode[buf[7]]);
          write(0x07,dispcode[buf[6]]);
          write(0x06,dispcode[10]);
          write(0x05,dispcode[buf[4]]);
          write(0x04,dispcode[buf[3]]);
          write(0x03,dispcode[10]);
          write(0x02,dispcode[buf[1]]);
          write(0x01,dispcode[buf[0]]);
          // Delayms(200);
          num++;
          if(num==137)
          num=0;
          for(r=0;r<105;r++)
          for(j=q;j<32+q;j++)
          {
          P1=tab2[t];
          KAI=1;
          P2=0X00;
          P2=tab1[j];
          KAI=0;
          j++;
          KAI2=1;
          P2=0X00;
          P2=tab1[j];
          KAI2=0;
          P0=tab3[num];
          delay(40);
          t++;
          if(t==16)
          t=0;
          }
          q=q+32;
          if(q==256)
          q=0;
          }
          }
          void delay(uint time)
          {
          uint linger;
          for(linger=0;linger}


          上一頁 1 2 下一頁

          評論


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