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

          新聞中心

          CD4053控制帶LCD顯示

          作者: 時(shí)間:2016-12-03 來源:網(wǎng)絡(luò) 收藏
          注:P1^6、P1^7分別為兩個(gè)功能鍵,P1^6為低通濾波器的級(jí)聯(lián)端即在其按下后同時(shí)分別按其他各鍵則為各個(gè)放大器連的低通,P1^7
          為同樣為高通濾波器的組合鍵。實(shí)際此電路是一個(gè)鍵控放大器,主要做的是10dB步進(jìn)可調(diào),帶LCD顯示。以下為keil中的程序:
          #include
          sbit lcdrs=P2^6;
          sbit lcden=P2^7;
          sbit lcdrw=P2^5;
          sbit D10=P1^0;
          sbit D20=P1^1;
          sbit D30=P1^2;
          sbit D40=P1^3;
          sbit D50=P1^4;
          sbit D60=P1^5;
          sbit lwchose=P1^6;
          sbit hgchose=P1^7;
          char code temp0[]="20LogAu=10dB";
          char code temp1[]="20LogAu=20dB";
          char code temp2[]="20LogAu=30dB";
          char code temp3[]="20LogAu=40dB";
          char code temp4[]="20LogAu=50dB";
          char code temp5[]="20LogAu=60dB";
          char code templ0[]="lw_10dB";
          char code templ1[]="lw_20dB";
          char code templ2[]="lw_30dB";
          char code templ3[]="lw_40dB";
          char code templ4[]="lw_50dB";
          char code templ5[]="lw_60dB";
          char code temph0[]="hg_10dB";
          char code temph1[]="hg_20dB";
          char code temph2[]="hg_30dB";
          char code temph3[]="hg_40dB";
          char code temph4[]="hg_50dB";
          char code temph5[]="hg_60dB";
          char num;
          void delay(int z);
          void write_com(char com)// 指令子函數(shù)
          {
          lcdrs=0;
          lcdrw=0;
          P0=com;
          delay(5);
          lcden=1;
          delay(5);
          lcden=0;
          lcdrw=1;
          lcdrs=1;
          }
          void write_data(char datae) // 數(shù)據(jù)子函數(shù)
          {
          lcdrs=1;
          lcdrw=0;
          P0=datae;
          delay(5);
          lcden=1;
          delay(5);
          lcden=0;
          }
          void init()
          {
          lcden=0;
          write_com(0x06); // 輸入方式的設(shè)置
          write_com(0x0c);
          write_com(0x14);
          write_com(0x01); //清屏
          write_com(0x02); //復(fù)位
          }
          void main()
          {
          init();
          lab: while (1)
          {
          if (D10==0)
          {
          write_com(0x01); //清屏
          P3=0x22;
          for(num=0;num<12;num++)
          {
          write_data(temp0[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto lab;
          }
          else if (D20==0)
          {
          write_com(0x01); //清屏
          P3=0x0a;
          for(num=0;num<12;num++)
          {
          write_data(temp1[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto lab;
          }

          else if (D30==0)
          {
          write_com(0x01); //清屏
          P3=0x02;
          for(num=0;num<12;num++)
          {
          write_data(temp2[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto lab;
          }
          else if (D40==0)
          {
          write_com(0x01); //清屏
          P3=0x04;
          for(num=0;num<12;num++)
          {
          write_data(temp3[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto lab;
          }
          else if (D50==0)
          {
          write_com(0x01); //清屏
          P3=0x08;
          for(num=0;num<12;num++)
          {
          write_data(temp4[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto lab;
          }
          else if (D60==0)
          {
          write_com(0x01); //清屏
          P3=0x00;
          for(num=0;num<12;num++)
          {
          write_data(temp5[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto lab;
          }
          TAB1: if (lwchose==0)
          {
          if (D10==0)
          {
          delay(5);
          if (D10==0)
          {
          write_com(0x01); //清屏
          P3=0x7a;
          for(num=0;num<7;num++)
          {
          write_data(templ0[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB1;
          }

          }
          else if (D20==0)
          {
          delay(5);
          if (D20==0)
          {
          write_com(0x01); //清屏
          P3=0x6a;
          for(num=0;num<7;num++)
          {
          write_data(templ1[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB1;
          }

          }
          else if (D30==0)
          {
          delay(5);
          if (D30==0)
          {
          write_com(0x01); //清屏
          P3=0x62;
          for(num=0;num<7;num++)
          {
          write_data(templ2[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB1;
          }
          }
          else if (D40==0)
          {
          delay(5);
          if (D40==0)
          {
          write_com(0x01); //清屏
          P3=0x64;
          for(num=0;num<7;num++)
          {
          write_data(templ3[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB1;
          }
          }
          else if (D50==0)
          {
          delay(5);
          if (D50==0)
          {
          write_com(0x01); //清屏
          P3=0x68;
          for(num=0;num<7;num++)
          {
          write_data(templ4[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB1;
          }
          }
          else if (D60==0)
          {
          delay(5);
          if (D60==0)
          {
          write_com(0x01); //清屏
          P3=0x60;
          for(num=0;num<7;num++)
          {
          write_data(templ5[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB1;
          }
          }
          }
          TAB2: if (hgchose==0)
          {
          if (D10==0)
          {
          delay(5);
          if (D10==0)
          {
          write_com(0x01); //清屏
          P3=0x3a;
          for(num=0;num<7;num++)
          {
          write_data(temph0[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB2;
          }

          }
          else if (D20==0)
          {
          delay(5);
          if (D20==0)
          {
          write_com(0x01); //清屏
          P3=0x2a;
          for(num=0;num<7;num++)
          {
          write_data(temph1[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB2;
          }

          }
          else if (D30==0)
          {
          delay(5);
          if (D30==0)
          {
          write_com(0x01); //清屏
          P3=0x22;
          for(num=0;num<7;num++)
          {
          write_data(temph2[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB2;
          }
          }
          else if (D40==0)
          {
          delay(5);
          if (D40==0)
          {
          write_com(0x01); //清屏
          P3=0x24;
          for(num=0;num<7;num++)
          {
          write_data(temph3[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB2;
          }
          }
          else if (D50==0)
          {
          delay(5);
          if (D50==0)
          {
          write_com(0x01); //清屏
          P3=0x28;
          for(num=0;num<7;num++)
          {
          write_data(temph4[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB2;
          }
          }
          else if (D60==0)
          {
          delay(5);
          if (D60==0)
          {
          write_com(0x01); //清屏
          P3=0x20;
          for(num=0;num<7;num++)
          {
          write_data(temph5[num]);
          delay(5);
          }
          write_com(0x80+10);
          goto TAB2;
          }
          }
          }
          }
          }
          void delay(int z)
          {
          int x,y;
          for(x=z;x>0;x--)
          for(y=110;y>0;y--);
          }


          關(guān)鍵詞: CD4053控制LCD顯

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