图中三极管于电阻没有用到,
c文件里面有教程;
hex也有;连线放式;
下面是图纸:
制作出来的实物图:
单片机源程序如下:
- /***采用四个74hc573,***/
- #include<reg52.h>
- sbit sao=P2^3; //573使能端前8位,行扫描
- sbit sao1=P2^2; //573使能端后8位,行扫描
- sbit su=P2^1; //573使能端前8位,列数据传送
- sbit su1=P2^0; //573使能端后8位,列数据传送
- unsigned char a,b,c;
- unsigned char code tbo[]={
- 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,
- 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80
- };//扫描数据,根据连线更改
- unsigned char code tbo1[30][32]={
- {0xFE,0xFE,0x00,0xFE,0xFE,0x80,0x93,0x99,
- 0x90,0x9E,0x9E,0x80,0x9E,0x9E,0x9E,0x9F,
- 0x7F,0x7F,0x00,0x7F,0x7F,0x01,0xC9,0x99,
- 0x09,0x79,0x79,0x01,0x79,0x79,0x61,0xF3},/*"南",0*/
- {0xFC,0xFE,0x00,0xF9,0xF9,0xF3,0xE7,0xC0,
- 0xF9,0xF9,0xF9,0xF9,0xF3,0xF3,0xE7,0x8F,
- 0xFF,0x7F,0x00,0xFF,0xFF,0xCF,0xE7,0x03,
- 0x93,0x9F,0x9F,0x9F,0x99,0x99,0x99,0xC1},/*"充",1*/
- {0xFE,0x02,0xF2,0xF2,0xF2,0x82,0x9E,0x98,
- 0x9E,0x82,0xF2,0xF2,0xF2,0xF2,0x86,0xCE,
- 0x7F,0x73,0x73,0x67,0x4F,0x1F,0x7F,0x00,
- 0x1F,0x4F,0x4F,0x67,0x73,0x19,0x3C,0x7F},/*"张",2*/
- {0xFC,0xCE,0xE0,0xE1,0x38,0x99,0x98,0xE0,
- 0xE0,0xC8,0x08,0xC8,0xC9,0xC8,0xC9,0xF9,
- 0xFF,0x01,0x79,0x99,0x01,0x99,0x01,0x01,
- 0x01,0x01,0x01,0x01,0x09,0x01,0x99,0x91},/*"澜",3*/
- {0xE7,0xE7,0xE7,0xE4,0x01,0xE7,0xE7,0xE0,
- 0xE3,0xC7,0x07,0xE7,0xE7,0xE7,0x86,0xC8,
- 0xCF,0xCF,0xCF,0x00,0xCF,0xCF,0xCF,0x01,
- 0x39,0x33,0x93,0x87,0xCF,0x87,0x33,0xF8},/*"技",4*/
- {0xF3,0xF0,0x93,0x93,0x93,0x92,0x92,0x92,
- 0x92,0x92,0x92,0xF2,0xE6,0xE7,0xCF,0x9F,
- 0xFF,0x00,0xCF,0xCF,0xCF,0x01,0x49,0x49,
- 0x49,0x49,0x49,0x41,0x43,0xCF,0xCF,0xCF},/*"师",5*/
- {0xCC,0xE6,0xE6,0xFF,0x80,0x9F,0x3F,0xE0,
- 0xFF,0xFE,0x00,0xFE,0xFE,0xFE,0xF8,0xFC,
- 0xF3,0x73,0x67,0xCF,0x00,0xFC,0xF9,0x0F,
- 0x9F,0x3F,0x00,0x7F,0x7F,0x7F,0x7F,0xFF},/*"学",6*/
- {0xFF,0x83,0x90,0x84,0x81,0x8E,0x87,0x93,
- 0x90,0x93,0x83,0x87,0x9E,0x9E,0x9C,0x99,
- 0x9F,0xCF,0x00,0xFC,0xF9,0x03,0xFF,0xFF,
- 0x00,0x27,0x27,0x27,0x64,0x64,0xF0,0xFF},/*"院",7*/
- {0xFE,0xFE,0xFC,0xF9,0xF3,0xE7,0xC0,0x1E,
- 0xFE,0xC0,0xFE,0xE6,0xF2,0xF2,0x00,0xFF,
- 0x7F,0x7F,0x3F,0x9F,0xCF,0xE7,0x03,0x78,
- 0x7F,0x03,0x7F,0x67,0x67,0x4F,0x00,0xFF},/*"金",8*/
- {0xF9,0xF9,0xF0,0xE7,0xCF,0x80,0x0E,0xCE,
- 0xC0,0xCE,0xCE,0xC0,0xFF,0xFF,0x00,0xFF,
- 0xFF,0xFF,0x0F,0xCF,0x9F,0x03,0x73,0x73,
- 0x03,0x73,0x73,0x03,0xFF,0xFF,0x00,0xFF},/*"鱼",9*/
- {0xE7,0xE7,0xE7,0xE7,0x81,0x80,0x80,0x81,
- 0x80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,0xE7,0xCF,0x9C,0x80,0xFF,0xFF},/*"2",32*/
- {0xFF,0xFF,0xFF,0x80,0x9C,0xF9,0xF9,0xF3,
- 0xF3,0xE7,0xE7,0xE7,0xE7,0xE7,0xFF,0xFF,/*"7",33*/
- 0xFF,0xFF,0xFF,0x80,0x9C,0xF9,0xF9,0xF3,
- 0xF3,0xE7,0xE7,0xE7,0xE7,0xE7,0xFF,0xFF},/*"7",34*/
- {0xFF,0xFF,0xFF,0xE3,0xC9,0x9C,0x9C,0x9C,
- 0x9C,0x9C,0x9C,0x9C,0xC9,0xE3,0xFF,0xFF,/*"0",35*/
- 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
- 0xFF,0xFF,0xFF,0xFF,0x8F,0x8F,0xFF,0xFF},/*".",36*/
- };
- /****上面就是列数据,数据可以用取模软件生成****/
- void main()
- {
- TMOD=0x01;
- TH0=(65536-50000)/256;
- TL0=(65536-50000)%256;
- TR0=1;
- /****这是时间设定****/
- while(1)
- {
- if(TF0==1)//判断定时设定是否溢出,
- {
- TF0=0; //溢出就清零。
- c++;
- if(c==16)//溢出16次为一秒,数据之间间隔。
- {
- c=0;
- b++; //这是数组个数,满30就重头开始。
- if(b==30)
- {
- b=0;
- }
- }
- }
- /*下面中每一次数据传输后都有个清屏,也就是消隐,数据32个中前16个是
- 每个字的前一半,同理后16个*/
- for(a=0;a<8;a++) //前8位扫描;
- {
- sao=1;
- P3=tbo[a];
- su=1;
- P1=tbo1[b][a];
- P1=0xff;
- su=0;
- su1=1;
- P1=tbo1[b][a+16];//A加16是数据前面8位;
- P1=0xff;
- su1=0;
- }
- P3=0x00;
- sao=0;
- for(a=8;a<16;a++) //后8位扫描;
- {
- sao1=1;
- P3=tbo[a];
- su=1;
- P1=tbo1[b][a];
- P1=0xff;
- su=0;
- su1=1;
- P1=tbo1[b][a+16]; //A加16是数据后面8位;
- P1=0xff;
- su1=0;
- }
- P3=0x00;
- sao1=0;
- a=0;
- …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码
所有资料51hei提供下载:
16x16显示(单片机).zip
(3.61 KB, 下载次数: 40)
|