1024手机基地看电影,午夜福利视频导航,国产精品福利在线一区,亚洲欧美日韩另类成人,在线观看午夜日本理论片,成年超爽免费网站,国产精品成人免费,精品动作一级毛片,成人免费观看网站,97精品伊人久久大香蕉

標題: 實用的51單片機程序 [打印本頁]

作者: 753951456852    時間: 2018-10-7 10:12
標題: 實用的51單片機程序
分享一個 拉幕式數碼顯示技術程序和仿真電路圖源碼:
#include <REGX51.H>

unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,

                               0x66,0x6d,0x7d,0x07,

                               0x7f,0x6f,0x77,0x7c,

                               0x39,0x5e,0x79,0x71,0x00};


/*unsigned char code dispcode[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,

0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0xff};

*/
unsigned char dispbitcode[]={0xf8,0xf9,0xfa,0xfb,

                             0xfc,0xfd,0xfe,0xff};


unsigned char dispbuf[8]={16,16,16,16,16,16,16,16};

unsigned char dispbitcnt;

unsigned int t02scnt;

unsigned char t5mscnt;

unsigned char u;

unsigned char i;



void main(void)

{

  TMOD=0x02;

  TH0=0x06;

  TL0=0x06;

  TR0=1;

  ET0=1;

  EA=1;

  while(1);

}



void t0(void) interrupt 1 using 0

{

  t5mscnt++;

  if(t5mscnt==4)

    {

      t5mscnt=0;

      P3=dispcode[dispbuf[dispbitcnt]];

      P1=dispbitcode[dispbitcnt];

      dispbitcnt++;

      if(dispbitcnt==8)

        {

          dispbitcnt=0;

        }

    }

  t02scnt++;

  if(t02scnt==1600)

    {

      t02scnt=0;

      u++;

      if(u==9)

        {

          u=0;

        }

      for(i=0;i<8;i++)

        {

          dispbuf[i]=16;

        }

      for(i=0;i<u;i++)

        {

          dispbuf[i]=i+1;

        }

    }

}


電路圖.png (107.11 KB, 下載次數: 40)

電路圖

電路圖





歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1