单片机51的C程序谁给解释下?

来源:百度知道 编辑:UC知道 时间:2024/05/27 18:26:17
#include <AT89X52.H>
#include <INTRINS.h>

unsigned char code displaybit[]={0xfe,0xfd,0xfb,0xf7,
0xef,0xdf,0xbf,0x7f};
unsigned char code displaycode[]={0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71,0x00,0x40};
unsigned char code dotcode[32]={0,3,6,9,12,16,19,22,
25,28,31,34,38,41,44,48,
50,53,56,59,63,66,69,72,
75,78,81,84,88,91,94,97};
unsigned char displaycount;
unsigned char displaybuf[8]={16,16,16,16,16,16,16,16};
unsigned char timecount;
unsigned char readdata[8];
sbit DQ=P3^7;
bit sflag;

bit resetpulse(void)
{
unsigned char i;

DQ=0;
for(i=255;i>0;i--);
DQ=1;
for(i=60;i>0;i--);
return(DQ);
for(i=200;i>0;i--);
}

void writecommandtods18b20(unsigned char command)
{
unsigned char i;
unsigned char j;

for(i=0;i<8;i++)
{
if(

unsigned char code displaybit[]={0xfe,0xfd,0xfb,0xf7,
0xef,0xdf,0xbf,0x7f};定义数码管显示位选数组
unsigned char code displaycode[]={0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71,0x00,0x40};定义共阴极数码管显示编码数组
unsigned char code dotcode[32]={0,3,6,9,12,16,19,22,
25,28,31,34,38,41,44,48,
50,53,56,59,63,66,69,72,
75,78,81,84,88,91,94,97};定义ds18b20表格数组
unsigned char displaycount;定义变量
unsigned char displaybuf[8]={16,16,16,16,16,16,16,16};定义显示缓冲
unsigned char timecount;定义变量(计数单元)
unsigned char readdata[8]; 定义变量
sbit DQ=P3^7;定义连接ds18b20端口
bit sflag;定义标致位

.....................
........................

解释了你看不懂,不解释你也看不懂,解释和不解释你都看不懂。

因为你不懂C语言……

不好意思,可以请您把这段程序大致所要实现的功能说一下吗?这样看起来不太好看......