#include<reg52.h>
#include<absacc.h>
#include<stdio.h>
#include<math.h>
typedef unsigned char uchar;
typedef unsigned int uint;
uchar tplsb,tpmsb;
uchar idata diss[8]={0,1,2,3,4,5,6,7};
uchar tempreg;
uchar coma, comb;
uchar hl;
sbit din=P3^5;
sbit clk=P3^4;
sbit load=P3^3;
sbit DQ=P3^7; //数据通信线
//温度测量并显示程序
void disp(uchar d,uchar hh);
void w7219(uchar coma,uchar comb);
void sd7219(uchar trans);
void fenli(uchar shishu,uchar xp);
//延时程序
void delay(uint t)
{
uint i;
while(t--)
{
for(i=0;i<125;i++);
}
}
//产生复位脉冲初始化ds18b20
void TxRest(void)
{
uint i;
DQ=0;
i=100;
while(i>0)
i--;
DQ=1;
i=4;
while(i>0)
i--;
}
//等待应答脉冲
void RxWait(void )
{
uint i;
while(DQ);
while(~DQ);
i=4;
while(i>0)
i--;
}
bit RdBit(void)
{
uint i;
bit b;
DQ=0;
i++;
DQ=1;
i++;i++;
b=DQ;
i=8;
while(i>0)i--;
return(b);
}
uchar RdByte(void)
{
uchar i,j,b;
b=0;
for(i=1;i<=8;i++)
{
j=RdBit();
b=(j<<7)|(b>>1);
}
return(b);
}
wenduji.zip_room control_room display
版权申诉
121 浏览量
2022-09-14
17:33:09
上传
评论
收藏 9KB ZIP 举报
小贝德罗
- 粉丝: 70
- 资源: 1万+
最新资源
- 驱动代码驱动代码驱动代码驱动代码
- SVID_20240523_141155_1.mp4
- Code for the complete guide to tkinter tutorial
- 关于百货中心供应链管理系统.zip
- SimpleFolderIcon-master 修改Unity的Project下的文件夹图标
- A python Tkinter widget to display tile based maps
- A pure Python library for adding tables to a Tkinter application
- Vector资源文件.zip
- MobaXterm-Installer
- 88-520告白(520气球).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈