0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示

Proteus教程:16x16点阵显示以及流水效果

Harmony&嵌入式学习 来源:Harmony&嵌入式学习 作者:Harmony&嵌入式学 2023-06-14 11:31 次阅读

视频链接:https://www.bilibili.com/video/BV1Hv4y1f7Uq

pYYBAGSJNF-AZBHrAAMa-6aT4yI944.pngpoYBAGSJNGWAEGBsAAKNqVqPywI372.pngpYYBAGSJNG-ANQ9uAAmmzmfTj-I123.pngpoYBAGSJNHOAWmdSAAMMogStzPI581.png
#include < reg52.h >
#include< intrins.h >				  				  
#define uchar unsigned char
#define uint unsigned int
uchar ROG[64];
uchar ROG_buff[64];
uchar l_num=0;
uchar w_num;
int time;
bit flag;
uchar play_mode;
uchar stay_flag;
uchar hang[]=	
{
0x00,0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x80,
0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x80,0x00,
};

uchar code lie[]=
{
0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0x00,0x01,0xFE,0xFF,0xFE,0xFF,
0xFD,0x7F,0xFD,0x7F,0xFB,0xBF,0xFB,0xBF,0xF7,0xDF,0xEF,0xEF,0xDF,0xF7,0x3F,0xF9,/*"大",0*/

0xFD,0xFF,0xFE,0xFF,0x80,0x01,0xBF,0xFD,0x7F,0xFB,0x80,0x03,0xFD,0xFF,0xF2,0xF7,
0x8E,0x6F,0xFD,0x5F,0xF3,0x3F,0x8E,0x5F,0xF9,0x67,0xE7,0x79,0x1D,0x7F,0xFE,0xFF,/*"家",1*/

0xEF,0xFF,0xEF,0x03,0xEF,0xFB,0xEF,0xF7,0x03,0xEF,0xDB,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1^5;
uchar i;
void delay(uchar z)		
{
     for(z;z>0;z--)
	 for(i=110;i>0;i--);
}

void send0(uchar temp0)	 
{
	for(i=0;i< 8;i++)
	{
	    sh0=0;
	    ds0=temp0&0x80;					
			temp0=temp0< <1;					
			sh0=1;
	}
}

void send1(uchar temp1)	 
{
	for(i=0;i< 8;i++)
	{
	    sh1=0;
	    ds1=temp1&0x80;
			temp1=temp1< <1;
			sh1=1;
	}
}

void Send_All(int A1,int A2,int B1,int B2)
{

			 send0(A1);     
		   send1(B1);
			 st0=0;
			 st1=0; 	
			 st0=1;
			 st1=1;
			 send0(A2);     
		   send1(B2);
			 st0=0;
			 st1=0; 	
			 st0=1;
			 st1=1;
	
	
}


void Show_One(uchar num)
{
	uchar i=0,j,n;
	for(j=0;j< 32;j++)
		{
		   send0(hang[j]);     
		   send1(lie[num*32+j]);
				n++;
				if(n==2)
				{   
					st0=0;
			    st1=0; 	
					st0=1;
					st1=1;
				   	n=0;
				}
		}
}




void Show_SX(uchar num)
{
		uchar i=0,j,n;
		int m,anw;
		if(num==1){anw = 16;}
		else{anw = num * 32;}
		for(j=0;j< 32;j++)
		{
		    send0(hang[j]);     
		    send1(lie[j+m]);
				n++;
			while(stay_flag);
				if(n==2)
				{   
					st0=0;
			    st1=0; 	
					st0=1;
					st1=1;
				   	n=0;
				}
				delay(1);
		 }
			delay(1);
			m+=2;			  
		  if(m==anw)m=0;			
}

void Show_ZY(uchar num)
{
	uchar i=0,j,n;
	for(j=0;j< 32;j++)
		{
		   send0(hang[j]);     
		   send1(lie[num*32+j]);
				n++;
				if(n==2)
				{   
					st0=0;
			    st1=0; 	
					st0=1;
					st1=1;
				   	n=0;
				}
		}
	
}
void Show_data()
{
	uchar i=0,j,n;
	for(j=0;j< 32;j++)
		{
		   send0(hang[j]);     
		   send1(ROG[j]);
				n++;
				if(n==2)
				{   
					st0=0;
			    st1=0; 	
					st0=1;
					st1=1;
				   	n=0;
				}
		}
	
}

void Control(uchar num)
{
	uchar i,j,m;
	num = num*2;
	time ++;
	
	if(time == 5)
	{
		time = 0;
		if(j==7)
		{
			j = 0;
	
			if(l_num< num)
			{
				
				if(flag)
				{
				for(m=0;m< 32;m++)
				{
						w_num = l_num/2;
						ROG_buff[2*m] = lie[w_num*32+2*m+1];
						ROG_buff[2*m+1] = lie[w_num*32+32+2*m];
				}
				flag = ~ flag;
				}else
				{
				for(m=0;m< 64;m++)
				{
					if(l_num!=0)
					{
						w_num = l_num/2;
						ROG_buff[m] = lie[w_num*32+m];
					}else
					{
						ROG_buff[m] = lie[m];
					}
				}
					flag = ~flag;
				}
				l_num++;
			}else
			{
				l_num = 0;
			
				
					for(m=0;m< 64;m++)
				{
						ROG_buff[m] = 0xff;
				}
				
				flag = 0;
			}
			
		}else
		{
			j++;
		}
		for(i=0;i< 16;i++)
		{
			ROG[2*i] = ROG_buff[2*i]< >(8-j);
			ROG[2*i+1] = ROG_buff[2*i+1]< >(8-j);
		}
		
	}
	while(stay_flag);
	Show_data();
	
	
}

void main()
{
	uchar m;
	for(m=0;m< 64;m++)
	{
		ROG_buff[m] = 0xff;
	}
   while(1)
	{
		//Show_One(3);
	//	Control(7);
		Show_SX(7);
  }
}

#include < reg52.h >
#include< intrins.h >				  				  
#define uchar unsigned char
#define uint unsigned int
uchar ROG[64];
uchar ROG_buff[64];
uchar l_num=0;
uchar w_num;
int time;
bit flag;
uchar play_mode;
uchar stay_flag;
uchar hang[]=	
{
0x00,0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x80,
0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x80,0x00,
};

uchar code lie[]=
{
0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0x00,0x01,0xFE,0xFF,0xFE,0xFF,
0xFD,0x7F,0xFD,0x7F,0xFB,0xBF,0xFB,0xBF,0xF7,0xDF,0xEF,0xEF,0xDF,0x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BF,0xEF,0xDF,0xDC,0x01,0x85,0xFD,0xB3,0xFB,0xB6,0x07,0xB7,0xFF,0xB7,0xFF,
0x84,0x01,0xB7,0x6F,0xB7,0x6F,0xB7,0x6F,0xB6,0xED,0x86,0xED,0xB5,0xF1,0xFB,0xFF,/*"皖",7*/
	


};
sbit sh0=P1^0;	  
sbit ds0=P1^1;					  
sbit st0=P1^2;					  
sbit sh1=P1^3;	 
sbit ds1=P1^4;
sbit st1=P1^5;
uchar i;
void delay(uchar z)		
{
     for(z;z>0;z--)
	 for(i=110;i>0;i--);
}

void send0(uchar temp0)	 
{
	for(i=0;i< 8;i++)
	{
	    sh0=0;
	    ds0=temp0&0x80;					
			temp0=temp0< <1;					
			sh0=1;
	}
}

void send1(uchar temp1)	 
{
	for(i=0;i< 8;i++)
	{
	    sh1=0;
	    ds1=temp1&0x80;
			temp1=temp1< <1;
			sh1=1;
	}
}

void Send_All(int A1,int A2,int B1,int B2)
{

			 send0(A1);     
		   send1(B1);
			 st0=0;
			 st1=0; 	
			 st0=1;
			 st1=1;
			 send0(A2);     
		   send1(B2);
			 st0=0;
			 st1=0; 	
			 st0=1;
			 st1=1;
	
	
}


void Show_One(uchar num)
{
	uchar i=0,j,n;
	for(j=0;j< 32;j++)
		{
		   send0(hang[j]);     
		   send1(lie[num*32+j]);
				n++;
				if(n==2)
				{   
					st0=0;
			    st1=0; 	
					st0=1;
					st1=1;
				   	n=0;
				}
		}
}




void Show_SX(uchar num)
{
		uchar i=0,j,n;
		int m,anw;
		if(num==1){anw = 16;}
		else{anw = num * 32;}
		for(j=0;j< 32;j++)
		{
		    send0(hang[j]);     
		    send1(lie[j+m]);
				n++;
			while(stay_flag);
				if(n==2)
				{   
					st0=0;
			    st1=0; 	
					st0=1;
					st1=1;
				   	n=0;
				}
				delay(1);
		 }
			delay(1);
			m+=2;			  
		  if(m==anw)m=0;			
}

void Show_ZY(uchar num)
{
	uchar i=0,j,n;
	for(j=0;j< 32;j++)
		{
		   send0(hang[j]);     
		   send1(lie[num*32+j]);
				n++;
				if(n==2)
				{   
					st0=0;
			    st1=0; 	
					st0=1;
					st1=1;
				   	n=0;
				}
		}
	
}
void Show_data()
{
	uchar i=0,j,n;
	for(j=0;j< 32;j++)
		{
		   send0(hang[j]);     
		   send1(ROG[j]);
				n++;
				if(n==2)
				{   
					st0=0;
			    st1=0; 	
					st0=1;
					st1=1;
				   	n=0;
				}
		}
	
}

void Control(uchar num)
{
	uchar i,j,m;
	num = num*2;
	time ++;
	
	if(time == 5)
	{
		time = 0;
		if(j==7)
		{
			j = 0;
	
			if(l_num< num)
			{
				
				if(flag)
				{
				for(m=0;m< 32;m++)
				{
						w_num = l_num/2;
						ROG_buff[2*m] = lie[w_num*32+2*m+1];
						ROG_buff[2*m+1] = lie[w_num*32+32+2*m];
				}
				flag = ~ flag;
				}else
				{
				for(m=0;m< 64;m++)
				{
					if(l_num!=0)
					{
						w_num = l_num/2;
						ROG_buff[m] = lie[w_num*32+m];
					}else
					{
						ROG_buff[m] = lie[m];
					}
				}
					flag = ~flag;
				}
				l_num++;
			}else
			{
				l_num = 0;
			
				
					for(m=0;m< 64;m++)
				{
						ROG_buff[m] = 0xff;
				}
				
				flag = 0;
			}
			
		}else
		{
			j++;
		}
		for(i=0;i< 16;i++)
		{
			ROG[2*i] = ROG_buff[2*i]< >(8-j);
			ROG[2*i+1] = ROG_buff[2*i+1]< >(8-j);
		}
		
	}
	while(stay_flag);
	Show_data();
	
	
}

void main()
{
	uchar m;
	for(m=0;m< 64;m++)
	{
		ROG_buff[m] = 0xff;
	}
   while(1)
	{
		//Show_One(3);
	//	Control(7);
		Show_SX(7);
  }
}

审核编辑:汤梓红

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
  • 嵌入式
    +关注

    关注

    5068

    文章

    19014

    浏览量

    303171
  • Proteus
    +关注

    关注

    79

    文章

    1692

    浏览量

    106367
  • 点阵
    +关注

    关注

    6

    文章

    194

    浏览量

    72469
  • 点阵显示
    +关注

    关注

    0

    文章

    18

    浏览量

    8316
收藏 人收藏

    评论

    相关推荐

    16x16点阵原理图

    16x16点阵原理图 16 16点阵采用了74HC138 ,74HC74等芯片。[此贴子已经被作者于2008-10-27 11:4
    发表于 10-27 11:38

    16x16点阵控制LED显示

    如何写16x16点阵控制LED显示屏的程序啊?江湖急救
    发表于 05-10 15:02

    16×16点阵(滚动显示)

    16×16点阵(滚动显示)PROTEUS仿真资料16×16
    发表于 08-01 16:41

    Proteus 8 Professional制作16x16点阵屏详细教程

    自己制作了个Proteus 8 Professional制作16x16点阵屏详细教程,也许对大家有用O(∩_∩)O!
    发表于 11-30 19:52

    单片机16x16点阵显示汉字程序

    单片机16x16点阵显示汉字程序,51单片机 16X192点阵程序动态显示任意汉字程序参考源代码
    发表于 07-14 07:10

    Proteus 16x16点阵元件库

    是完整的16x16点阵,类似于8x8,但不是8x8组合成的
    发表于 11-02 16:20 87次下载

    16x16点阵显示

    用AT89C51单片机控制四块8x8点阵组成的16x16点阵显示屏,流动显示字幕
    发表于 11-18 10:21 47次下载

    10.1.9 一个16×16点阵汉字显示

    Proteus之一个16×16点阵汉字显示,很好的Proteus资料,快来下载不学习吧。
    发表于 04-18 17:11 0次下载

    Proteus之两个16×16点阵汉字显示

    Proteus之两个16×16点阵汉字显示,很好的Proteus资料,快来下载不学习吧。
    发表于 04-18 17:11 0次下载

    Proteus之两个16×16点阵汉字分批显示

    Proteus之两个16×16点阵汉字分批显示,很好的Proteus资料,快来下载不学习吧。
    发表于 04-18 17:11 0次下载

    16x16点阵仿真的工程文件免费下载

    本文档的主要内容详细介绍的是16x16点阵仿真的工程文件免费下载。
    发表于 12-20 08:00 18次下载
    <b class='flag-5'>16x16</b><b class='flag-5'>点阵</b>仿真的工程文件免费下载

    使用8255芯片和74LS154设计的16X16点阵屏的仿真电路图免费下载

    本文档的主要内容详细介绍的是使用8255芯片和74LS154设计的16X16点阵屏的仿真电路图免费下载。
    发表于 12-30 17:48 22次下载
    使用8255芯片和74LS154设计的<b class='flag-5'>16X16</b><b class='flag-5'>点阵</b>屏的仿真电路图免费下载

    16X16点阵编写技巧的思路

    来说一下16X16点阵的编写技巧,主要讲一下思路,因为在写16X16点阵驱动时,很多人一上来大脑一片空白啊,根本无从下手,我这里举一个例子讲下思路,以后大家可以按照我下面的思路来写程序
    的头像 发表于 10-26 11:16 6931次阅读
    <b class='flag-5'>16X16</b><b class='flag-5'>点阵</b>编写技巧的思路

    16x16点阵滚动显示汉字74HC595程序仿真原理图驱动文件

    16x16点阵滚动显示汉字程序+仿真原理图 74HC595驱动资料文件下载
    发表于 08-29 10:16 49次下载

    基于51单片机的16x16点阵显示例程源代码

    基于51单片机的16x16点阵显示例程源代码
    发表于 05-12 16:07 58次下载