51单片机8×8LED点阵屏显示数字动态显示+ Proteus仿真

51单片机8×8LED点阵屏显示数字动态显示+ Proteus仿真


  • Proteus仿真
    在这里插入图片描述
  • 取模软件:pctolcd2002

取模方式:逐列式,顺向取模

在这里插入图片描述

程序源码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
//取模方式:逐列式,顺向取模
uchar code Table_OF_Digits[]=
{
0x00,0x3e,0x41,0x41,0x41,0x3e,0x00,0x00,
0x00,0x00,0x00,0x21,0x7f,0x01,0x00,0x00,
0x00,0x27,0x45,0x45,0x45,0x39,0x00,0x00,
0x00,0x22,0x49,0x49,0x49,0x36,0x00,0x00,
0x00,0x0c,0x14,0x24,0x7f,0x04,0x00,0x00,
0x00,0x72,0x51,0x51,0x51,0x4e,0x00,0x00,
0x00,0x3e,0x49,0x49,0x49,0x26,0x00,0x00,
0x00,0x40,0x40,0x40,0x4f,0x70,0x00,0x00,
0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x00,
0x00,0x32,0x49,0x49,0x49,0x3e,0x00,0x00,
};
uchar i=0,t=0,Num_Index = 0;

void main()
{
P3 = 0x80;
Num_Index = 0;
TMOD = 0x00;
TH0 = (8192-2000)/32;
TL0 = (8192-2000)%32;
TR0 = 1;
IE = 0x82;
while(1);
}

void LED\_Screen\_Display() interrupt 1
{
TH0 = (8192-2000)/32;
TL0 = (8192-2000)%32;
P3 = \_crol\_(P3,1);
P0 = ~Table_OF_Digits[Num_Index \* 8 +i];
if(++i == 8) i = 0;
if(++t == 250)
{
t = 0x00;
if(++Num_Index == 10) Num_Index = 0;
}
}

程序源码和仿真资源

1
2
3
链接:https://pan.baidu.com/s/1RvmvMTKdB-B7WBVINjuNew 
提取码:jf4l