proteus中源代码
74HC245
74HC595
AT89C51
BUTTON
CAP
CAP-ELEC
CRYSTAL
MATRIX-8X8-ORANGE
MATRIX-8X8-RED
电路图在下面文件中

keil5代码

#include<reg51.h>
#define uchar unsigned char 
#define uint unsigned int 
#define ulonf unsigned long
sbit MOSIO = P0^0;
sbit R_CLK = P0^2;
sbit S_CLK = P0^1;
void HC595SendDate(uchar BT0);
void delayms(unsigned int i);
void main(void )
{ 
    unsigned char code led[]={0xff,0xe7,0xc7,0xe7,0xe7,0xe7,0xe7,0xe7,
	                          0xff,0x87,0xf3,0xf3,0xc7,0xf3,0xf3,0x87,
							  0xff,0x87,0xbf,0x87,0xf3,0xf3,0xf3,0x87,
							  0xff,0xc7,0x93,0x93,0x93,0xc3,0xf3,0xc7,
							  0xff,0x87,0xf3,0xf3,0xc7,0x9f,0x9f,0x83,
							  0xff,0x87,0xf3,0xf3,0xc7,0xf3,0xf3,0x87,
							  0xff,0xf3,0xe3,0xd3,0xb3,0x83,0xf3,0xf3,
							  0xff,0xc7,0x9f,0x87,0x93,0x93,0x93,0xc7,
							  0xff,0x03,0xf3,0xe7,0xe7,0xcf,0xcf,0xcf,
							  0xff,0xc7,0x93,0x93,0xc7,0x93,0x93,0xc7,
							  0xff,0xc7,0x9f,0x87,0x93,0x93,0x93,0xc7};
	unsigned char w;
	unsigned int i,j,k,m;
	while(1){
	   for(k=0;k<88;k++){
	      for(m=0;m<100;m++){
		      w=0x01;
			  j=k;
			  for(i=0;i<8;i++){
			      P1=w;
				  HC595SendDate(led[j]);
				  delayms(2);
				  HC595SendDate(0xff);
				  w<<=1;
				  j++;
				  if(j>87)
				  j=j-88;
			  }
		  }
	   }
	}
							   
}



void HC595SendDate(uchar BT0){
    uchar i;
	for(i=0;i<8;i++){
	   MOSIO  = BT0>>7;
	   BT0<<=1;
	   S_CLK = 0;
	   S_CLK = 1;
	}
	R_CLK = 0;
	R_CLK = 1;
	R_CLK = 0;
}

void delayms(unsigned int i){
    unsigned char k;
	while(i--)
	   for(k=0;k<120;k++);   
	   
}			   

资源都在下面文件中,请自行下载

相关文件下载地址
*该资源需回复评论后下载,马上去发表评论?
©下载资源版权归作者所有;本站所有资源均来源于网络,仅供学习使用,请支持正版!

被岁月冰封的一簇火苗,等待理想把它融化、燃烧。