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

📄 dis.c

📁 飞利浦公司生产的75A温度读取芯片配合C51单片机读取温度
💻 C
字号:
//*****显示总函数*****//
#include "dis.h"
unchar tabduan[]={0xfc,0x60,0xda,0xf2,0x66,0xb6,0xbe,0xe0,0xfe,0xf6,0xc6,0x9c,0x01};
unchar tabwei[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
unchar tabwei1[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
unchar ta[]={0xfd,0x61,0xdb,0xf3,0x67,0xb7,0xbf,0xe1,0xff,0xf7,0xc6,0x9c};
//*****显示没有小数点的显示函数****////
void send8sbit(unchar temp)
{
	unchar i;
	for(i=0;i<8;i++)
		{
			sclk=0;
			datain=temp&0x01;
			sclk=1;
			temp=temp>>1;
		}
		sclk=0;
}
void sendw(unchar wei)
{
	unchar temp;
	temp=tabwei[wei];
	rck=0;
	send8sbit(temp);
	rck=1;
	gate=0;
}
void sendshur(unchar shu)
{
	unchar temp;
	gate=1;
	temp=tabduan[shu];
	send8sbit(temp);
	send8sbit(0x00);
}
void sendshul(unchar shu)
{
	unchar temp;
	gate=1;
	temp=tabduan[shu];
	send8sbit(0x00);
	send8sbit(temp);
}

void displayr(unchar wei,unchar shu)
{	
	sendshur(shu);	
	sendw(wei);
}	
void displayl(unchar wei,unchar shu)
{
	sendshul(shu);
	sendw(wei);
}	
void mydisplay(unchar wei,unchar shu)
{
	if(wei<8)
		{
		displayl(wei,shu);
		}
	else
		{
		displayr(wei%8,shu);
		}
}
/////////////////////////////////
////////////////////////////////
///////////////////////////////
//****能显示小数点显示函数*****//
void send8sbit1(unchar temp1)
{
	unchar i;
	for(i=0;i<8;i++)
		{
			sclk=0;
			datain=temp1&0x01;
			sclk=1;
			temp1=temp1>>1;
		}
		sclk=0;
}
void sendw1(unchar wei1)
{
	unchar temp1;
	temp1=tabwei1[wei1];
	rck=0;
	send8sbit1(temp1);
	rck=1;
	gate=0;
}
void sendshur1(unchar shu1)
{
	unchar temp1;
	gate=1;
	temp1=ta[shu1];
	send8sbit1(temp1);
	send8sbit1(0x00);
}
void sendshul1(unchar shu1)
{
	unchar temp1;
	gate=1;
	temp1=ta[shu1];
	send8sbit1(0x00);
	send8sbit1(temp1);
}void displayr1(unchar wei1,unchar shu1)
{	
	sendshur1(shu1);	
	sendw1(wei1);
}	
void displayl1(unchar wei1,unchar shu1)
{
	sendshul1(shu1);
	sendw1(wei1);
}
void mydisplay1(unchar wei1,unchar shu1)
{
	if(wei1<8)
		{
		displayl1(wei1,shu1);
		}
	else
		{
		displayr1(wei1%8,shu1);
		}
}	



⌨️ 快捷键说明

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