单片机C语言程序设计实训100例

源代码在线查看: 8.c

软件大小: 12498 K
上传用户: zaindyclg
关键词: 100 单片机 C语言 程序设计
下载地址: 免注册下载 普通下载 VIP

相关代码

				/***************   writer:shopping.w   ******************/
				#include 
				#include 
				#define uint unsigned int
				#define uchar unsigned char
				#define PA XBYTE[0x0000] 
				#define PB XBYTE[0x0001]
				#define PC XBYTE[0x0002]
				#define COM XBYTE[0x0003]
				
				uchar code DSY_CODE_Queue[]=
				{
				 	0xff,0xff,0xff,0xff,0xff,0xff,0xff,
					0xa4,0xc0,0xc0,0x80,0xc0,0x80,0xf9,0x80,
					0xff,0xff,0xff,0xff,0xff,0xff,0xff
				};
				
				uchar code DSY_Index[]=
				{
				 	0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80
				};
				
				void Delay(uint x)
				{
				 	uchar i;
					while(x--)
					{
					 	for(i=0;i					}
				}
				
				void main()
				{
				 	uchar i,j,k;
					COM = 0x80;
					while(1)
					{
					 	for(j=0;j						{
						 	for(k=0;k							{
								PB = DSY_Index[k];
								PA = DSY_CODE_Queue[k+i];
								Delay(1);
							}
						}
						i = (i+1)%15;
					}
				}			

相关资源