⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 text1.c

📁 点阵显示
💻 C
字号:
#include <at89x51.h>
#include <intrins.h>

#define uchar 	unsigned char
#define uint 	unsigned int
#define RED 	1
#define GREEN 	0



sbit STB	=	P2^0;
sbit CLK	=	P2^1;
sbit GDATA	=	P2^2;
sbit RDATA	=	P2^3;
sbit G		=	P2^4;
sbit G2		=	P2^5;
sbit GDATA2	=	P2^6;
sbit RDATA2	=	P2^7;
sbit CLK2	=	P3^0;

void delay(uint );
void SendByte(uchar ,bit );
void SendByte2(uchar ,bit  );
void Display(uchar *,uchar *,uchar *,uchar *);
#define LINE	P1
uchar j=0,k=0,l,m; 


uchar code FONT16X16[8][96]=
{
//汤
//超级字符/图形字模提取软件 V1.0 作者:管廷卫  电邮:guantingwei@163.com
//C51 Code,逐行从上到下取模,每行左为最高位
//Creat By Super Led_Dot_Matrix Char V1.0
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x02,0x1F,0x80,0x01,0x00,0x80,0x01,0x01,0x80,0x00,0x03,0x00,0x00,0x26,0x00,0x00,0x24,0x38,0x0C,0x49,0xEC,0x0E,0xDF,0x8C,0x02,0xBD,0x84,0x02,0xA9,0x84,0x03,0x09,0x04,0x03,0x0B,0x04,0x02,0x0A,0x0C,0x06,0x1E,0x08,0x06,0x1C,0x08,0x04,0x1C,0x08,0x0C,0x1C,0x08,0x08,0x1C,0x18,0x18,0x0C,0x10,0x00,0x12,0x30,0x00,0x13,0x20,0x00,0x31,0x60,0x00,0x60,0xC0,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

//小
//超级字符/图形字模提取软件 V1.0 作者:管廷卫  电邮:guantingwei@163.com
//C51 Code,逐行从上到下取模,每行左为最高位
//Creat By Super Led_Dot_Matrix Char V1.0
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x20,0x00,0x00,0x20,0x00,0x00,0x30,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x10,0x60,0x00,0x10,0x30,0x02,0x10,0x10,0x03,0x10,0x10,0x03,0x10,0x10,0x03,0x10,0x10,0x03,0x10,0x30,0x01,0x10,0x30,0x01,0x10,0x20,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

//艳
//超级字符/图形字模提取软件 V1.0 作者:管廷卫  电邮:guantingwei@163.com
//C51 Code,逐行从上到下取模,每行左为最高位
//Creat By Super Led_Dot_Matrix Char V1.0
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x06,0x00,0x06,0x02,0x00,0x02,0x03,0x80,0x02,0x03,0xC0,0x03,0x02,0xC0,0x01,0x00,0x80,0x09,0xC1,0x80,0x0F,0x01,0x10,0x01,0x83,0xF8,0x07,0x83,0x98,0x0D,0x26,0x90,0x01,0xE6,0xD0,0x01,0xC4,0xF0,0x0F,0x85,0xE0,0x3D,0x85,0xC0,0x38,0x87,0x00,0x00,0x86,0x00,0x01,0x84,0x00,0x01,0x84,0x06,0x01,0x02,0x0C,0x01,0x81,0xF8,0x01,0x80,0x00,0x01,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

//!
//超级字符/图形字模提取软件 V1.0 作者:管廷卫  电邮:guantingwei@163.com
//C51 Code,逐行从上到下取模,每行左为最高位
//Creat By Super Led_Dot_Matrix Char V1.0
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

//欢
//超级字符/图形字模提取软件 V1.0 作者:管廷卫  电邮:guantingwei@163.com
//C51 Code,逐行从上到下取模,每行左为最高位
//Creat By Super Led_Dot_Matrix Char V1.0
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x0C,0x00,0x00,0x04,0x00,0x00,0x04,0x70,0x00,0x04,0xF0,0x00,0x05,0xB0,0x00,0x07,0x30,0x06,0x07,0x30,0x0F,0x87,0x20,0x00,0x83,0x60,0x00,0x82,0x40,0x1C,0x83,0xC0,0x05,0x87,0x80,0x03,0x04,0x00,0x03,0x06,0x00,0x03,0x0F,0x00,0x03,0x89,0x80,0x02,0x98,0x80,0x0C,0xD0,0xC0,0x0C,0x70,0x60,0x08,0x60,0x30,0x00,0x00,0x18,0x00,0x00,0x0C,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

//迎
//超级字符/图形字模提取软件 V1.0 作者:管廷卫  电邮:guantingwei@163.com
//C51 Code,逐行从上到下取模,每行左为最高位
//Creat By Super Led_Dot_Matrix Char V1.0
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x9E,0x00,0x01,0xF8,0x00,0x01,0xE0,0x00,0x00,0x80,0x20,0x18,0x81,0xF0,0x18,0x81,0x90,0x08,0x83,0x30,0x0C,0x87,0x30,0x04,0x8D,0x20,0x00,0x99,0x60,0x00,0xB1,0xC0,0x00,0xE1,0x80,0x08,0xC1,0x00,0x08,0x01,0x00,0x0C,0x03,0x00,0x04,0x03,0x00,0x76,0x03,0x00,0x3E,0x02,0x00,0x0F,0x02,0x00,0x01,0xE2,0x1F,0x00,0x3F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

//您
//超级字符/图形字模提取软件 V1.0 作者:管廷卫  电邮:guantingwei@163.com
//C51 Code,逐行从上到下取模,每行左为最高位
//Creat By Super Led_Dot_Matrix Char V1.0
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0C,0x00,0x01,0x0C,0x30,0x01,0x0C,0xF8,0x01,0x05,0x98,0x03,0x07,0x18,0x02,0x07,0x90,0x03,0x05,0xB0,0x07,0x00,0xA0,0x05,0x04,0xC0,0x0D,0x04,0xB0,0x09,0x04,0x98,0x01,0x86,0x88,0x01,0x8E,0x88,0x01,0x8F,0x80,0x01,0x89,0x80,0x01,0x81,0x80,0x01,0xC1,0x80,0x01,0xC0,0x00,0x00,0xC0,0x00,0x01,0x9D,0x60,0x01,0x8F,0x38,0x03,0xC0,0x00,0x02,0x60,0x80,0x04,0x30,0x40,0x0C,0x1C,0x40,0x18,0x07,0xC0,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

//!
//超级字符/图形字模提取软件 V1.0 作者:管廷卫  电邮:guantingwei@163.com
//C51 Code,逐行从上到下取模,每行左为最高位
//Creat By Super Led_Dot_Matrix Char V1.0
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x0E,0x00,0x00,0x0E,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00


};

void main(void)
{
	uint i;
	STB=0;
	G=0;

	while(1)
	{
		for(i=100;i;i--)
	      		Display(FONT16X16[0],FONT16X16[1],FONT16X16[2],FONT16X16[3]);

		for(i=100;i;i--)
	      		Display(FONT16X16[4],FONT16X16[5],FONT16X16[6],FONT16X16[7]);
	}
	

}


void SendByte(uchar dat,bit colour)
{
	uchar i;
	for(i=8;i>0;i--)
	{
		CLK=0;
		if(colour)
		{
			if(dat&0x80)	RDATA=1;
			else			RDATA=0;
			GDATA=0;
		}
		else
		{
			if(dat&0x80)	GDATA=1;
			else			GDATA=0;
			RDATA=0;
		}
		CLK=1;
		dat=dat<<1;
	}
}

void SendByte2(uchar dat,bit colour)
{
	uchar i;
	for(i=8;i>0;i--)
	{
		CLK2=0;
		if(colour)
		{
			if(dat&0x80)	RDATA2=1;
			else			RDATA2=0;
			GDATA2=0;
		}
		else
		{
			if(dat&0x80)	GDATA2=1;
			else			GDATA2=0;
			RDATA2=0;
		}
		CLK2=1;
		dat=dat<<1;
	}
}


void Display(uchar *dat1,uchar *dat2,uchar *dat3,uchar *dat4)
{
	uchar i;
	for(i=0;i<16;i++)
	{
		SendByte(dat1[3*i],GREEN);SendByte(dat1[3*i+1],GREEN);SendByte(dat1[3*i+2],GREEN);
		SendByte(dat2[3*i],GREEN);SendByte(dat2[3*i+1],GREEN);SendByte(dat2[3*i+2],GREEN);
		SendByte(dat3[3*i],GREEN);SendByte(dat3[3*i+1],GREEN);SendByte(dat3[3*i+2],GREEN);
		SendByte(dat4[3*i],GREEN);//SendByte(dat4[3*i+1],GREEN);SendByte(dat4[3*i+2],GREEN);
 
		SendByte2(dat1[3*(i+16)],GREEN);SendByte2(dat1[3*(i+16)+1],GREEN);SendByte2(dat1[3*(i+16)+2],GREEN);
		SendByte2(dat2[3*(i+16)],GREEN);SendByte2(dat2[3*(i+16)+1],GREEN);SendByte2(dat2[3*(i+16)+2],GREEN);
		SendByte2(dat3[3*(i+16)],GREEN);SendByte2(dat3[3*(i+16)+1],GREEN);SendByte2(dat3[3*(i+16)+2],GREEN);
		SendByte2(dat4[3*(i+16)],GREEN);//SendByte2(dat4[3*(i+16)+1],GREEN);SendByte2(dat4[3*(i+16)+2],GREEN);

		G=1;
		_nop_();
		_nop_();
		STB=1;
		_nop_();
		_nop_();
		_nop_();
		_nop_();
		LINE++;
		STB=0;
		G=0;
//		delay(80);
	}

}

void delay(uint i)
{
	while(--i);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -