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

📄 led88.c

📁 51单片机用c语言实例 包括ad
💻 C
字号:
/**************************************************************/
/* 文件名称: Led88.C                                          */
/* 功能描述: 控制点阵显示'口'符号                             */
/**************************************************************/

#include "SST89x5x4.h"
#include "Intrins.h"

typedef unsigned char uchar;
//符号数据
static uchar Value1[]={0xff,0x81,0x81,0x81,0x81,0x81,0x81,0xff};
static uchar Value2[]={0x00,0x7e,0x42,0x42,0x42,0x42,0x7e,0x00};
static uchar Value3[]={0x00,0x00,0x3c,0x24,0x24,0x3c,0x00,0x00};
static uchar Value4[]={0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00};

void delay(uchar count)				//延时函数
{
	uchar i;
	uchar j;
	for(j=0;j<count;j++)
		for(i=0;i<0x50;i++);
}

void main(void)
{
	uchar L_con = 0x7f, i, j;		//L_con: 列扩展变量
	while(1)
	{
		for(j=0; j<200; j++)		//第一个图形显示
		{
			for(i=0; i<8; i++)
			{
				P0 = L_con;
				P2 = Value1[i];
				L_con = _cror_(L_con, 1);
				delay(1);
			}
		}
		delay(10);
		for(j=0; j<200; j++)		//第二个图形显示
		{
			for(i=0; i<8; i++)
			{
				P0 = L_con;
				P2 = Value2[i];
				L_con = _cror_(L_con, 1);
				delay(1);
			}
		}
		delay(10);
		for(j=0; j<200; j++)		//第三个图形显示
		{
			for(i=0; i<8; i++)
			{
				P0 = L_con;
				P2 = Value3[i];
				L_con = _cror_(L_con, 1);
				delay(1);
			}
		}
		delay(10);
		for(j=0; j<200; j++)		//第四个图形显示
		{
			for(i=0; i<8; i++)
			{
				P0 = L_con;
				P2 = Value4[i];
				L_con = _cror_(L_con, 1);
				delay(1);
			}
		}
		delay(10);
	}
}

⌨️ 快捷键说明

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