仿真原理图如下(proteus仿真工程文件可到本帖附件中下载)
单片机源程序如下:
- #include<reg52.h>
- unsigned int a,b,c;
- unsigned char code tab[]={0xfe,0xfd,0xfb,0xf7,
- 0xef,0xdf,0xbf,0x7f};
- unsigned char code tab1[10][8]={
- {0x00,0x00,0x3e,0x41,0x41,0x41,0x3e,0x00}, //0
- {0x00,0x00,0x00,0x00,0x21,0x7f,0x01,0x00}, //1
- {0x00,0x00,0x27,0x45,0x45,0x45,0x39,0x00}, //2
- {0x00,0x00,0x22,0x49,0x49,0x49,0x36,0x00}, //3
- {0x00,0x00,0x0c,0x14,0x24,0x7f,0x04,0x00}, //4
- {0x00,0x00,0x72,0x51,0x51,0x51,0x4e,0x00}, //5
- {0x00,0x00,0x3e,0x49,0x49,0x49,0x26,0x00}, //6
- {0x00,0x00,0x40,0x40,0x40,0x4f,0x70,0x00}, //7
- {0x00,0x00,0x36,0x49,0x49,0x49,0x36,0x00}, //8
- {0x00,0x00,0x32,0x49,0x49,0x49,0x3e,0x00} //9
- };
- void main()
- {
- TMOD=0x01;
- TH0=(65536-50000)/256;
- TL0=(65536-50000)%256;
- TR0=1;
- while(1)
- {
- P3=tab[b];
- P1=tab1[c][b];
- b++;
- if(b==8)
- {
- b=0;
- }
- if(TF0==1)
- {
- TF0=0;
- a++;
- if(a==10)
- {
- a=0;
- c++;
- if(c==10)
- ……………………
- …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码
所有资料51hei提供下载:
8x8显示.rar
(42.61 KB, 下载次数: 58)
|