LED点阵动画

23-7-6

LED点阵动画_第1张图片LED点阵动画_第2张图片

 

 

#include
#include "Delay.h"
#include "Matrix.h"
/*点阵屏显示动画*/
unsigned char code Animation[]={
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0xff,0x08,0x08,0x08,0xff,0x00,0x0e,0x15,
  0x15,0x15,0x08,0x00,0x7e,0x01,0x02,0x00,
  0x7e,0x01,0x02,0x00,0x0e,0x11,0x11,0x0e,
  0x00,0x7d,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};

void main()
{
	unsigned char i,offset=0,Count=0;
	Matrix_Init();	
	while(1)
	{
	/*刷新8列*/
		for(i=0;i<8;i++)
		{
			 MatrixLED_ShowColumn(i,Animation[i+offset]);
		}
		//
		Count++;
		if(Count>10) //扫描10次移动一位,相当于延时
		{
			Count=0;
			offset++;
			if(offset>40)
				offset=0;	
		}
	}
}

你可能感兴趣的:(单片机)