led数字显示 LED8X8点阵显示数字0-9数字

下面是电路图:

/*名称:8X8LED点阵显示数字

说明:1.8X8LED点阵屏循环显示数字0~9,刷新过程为动态变换完成。

2.行扫描为XXled数字显示,接P1口,列扫描为YYled数字显示,接P3口

*/

#include

#include

#define uchar unsigned char

#define uint unsigned int

uchar code XX[]=

{

0x00,0x3e,0x41,0x41,0x41,0x3e,0x00,0x00,//0

0x00,0x00,0x00,0x21,0x7f,0x01,0x00,0x00,//1

0x00,0x27,0x45,0x45,0x45,0x39,0x00,0x00,//2

0x00,0x22,0x49,0x49,0x49,0x36,0x00,0x00,//3

0x00,0x0c,0x14,0x24,0x7f,0x04,0x00,0x00,//4

0x00,0x72,0x51,0x51,0x51,0x4e,0x00,0x00,//5

0x00,0x3e,0x49,0x49,0x49,0x26,0x00,0x00,//6

0x00,0x40,0x40,0x40,0x4f,0x70,0x00,0x00,//7

0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x00,//8

0x00,0x32,0x49,0x49,0x49,0x3e,0x00,0x00//9

};

uchar code YY[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};

uchar i,k,j,t=0,Num_Index;

void yanchi(uchar ms)

{

while(ms--)

{

for (i=0;i }

}

//主程序

void main()

{

while(1)

{

for(t=0;t {

for(j=0;j {

for(k=0;k {

P1=YY[k];

P3=~XX[t*8+k];

yanchi(2);

}

}//**************************0

}

}

}

/*******************************************************************************************/

#include

#include

#define uchar unsigned char

#define uint unsigned int

uchar code XX[]=

{

0x00,0x3e,0x41,0x41,0x41,0x3e,0x00,0x00,//0

0x00,0x00,0x00,0x21,0x7f,0x01,0x00,0x00,//1

0x00,0x21,0x43,0x45,0x49,0x31,0x00,0x00,//2

0x00,0x22,0x49,0x49,0x49,0x36,0x00,0x00,//3

0x00,0x0c,0x14,0x24,0x7f,0x04,0x00,0x00,//4

0x00,0x72,0x51,0x51,0x51,0x4e,0x00,0x00,//5

0x00,0x3e,0x49,0x49,0x49,0x26,0x00,0x00,//6

0x00,0x40,0x40,0x4f,0x50,0x60,0x00,0x00,//7

0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x00,//8

0x00,0x32,0x49,0x49,0x49,0x3e,0x00,0x00//9

};

uchar code YY[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};

uint i,k,j,t;

void yanchi(uchar ms)

{

while(ms--)

{

for (i=0;i }

}

//主程序

void main()

{

while(1)

{

for(t=0;t {

for(j=0;j {

for(k=0;k {

P1=YY[k];

P2=~XX[(t)*8+k];

P3=~XX[((t0)/10)*8+k];

P0=~XX[(t/100)*8+k];

yanchi(2);

}

}//**************************0

}

}

}

文章由启和科技编辑


上一篇:led显示屏市场 2021年中国LED显示屏市场分析报告

下一篇:led显示屏市场 2020年中国LED显示屏市场现状及发展趋势预测分析

TAG标签: LED显示屏