云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 数字温度检测系统的设计报告 - 图文

数字温度检测系统的设计报告 - 图文

  • 62 次阅读
  • 3 次下载
  • 2025/6/20 19:31:46

陕西理工学院毕业设计

图C2 仿真图

第39页 共48页

陕西理工学院毕业设计

图C3 实物图

第40页 共48页

附录D 源代码:

#include #define uchar unsigned char #define uint unsigned int

uchar code table0[]=%uchar code table1[]=\sbit lcdrs=P3^2; sbit lcdrw=P3^3; sbit lcden=P3^4; sbit ds=P0^0; sbit ledr=P2^5; sbit ledg=P2^6; sbit ledy=P2^7; sbit re=P3^0; sbit le=P3^1; sbit buzz=P3^7; bit flag; uchar num; uint temp,t=0,tt;

uchar temp_fen,temp_miao,temp_shi,temp_ge,temp_little;float xs_temp;

void delay(uint z)//延时1ms子程序 { uint x,y;

for(x=z;x>0;x--)

for(y=110;y>0;y--);

}

void ds_reset( ) //DS18B20初始化 { uint i; bit pw=1; while(pw) {

ds=1;

陕西理工学院毕业设计

第41页 共48页

i++; ds=0; i=103;

while(i>0)i--;//835us ds=1; i=4;

while(i>0)i--;//35us pw=ds;

}

i=70;

while(i>0)i--;//604us ds=1;

}

void temp_wr_byte(uchar dat)//DS18B20写一个字节的数据子程序{ bit testb; uchar j; uint i;

for(j=0;j<8;j++) { testb=dat&0x01; dat=dat>>1;

if(testb) //textb为真写1, { ds=0; //i++;i++;

i=1;

while(i>0)i--; //至少1us ds=1; i=8;

while(i>0)i-- ; //66us

} else {

ds=0;

//写0

陕西理工学院毕业设计

第42页 共48页

搜索更多关于: 数字温度检测系统的设计报告 - 图文 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

陕西理工学院毕业设计 图C2 仿真图 第39页 共48页 陕西理工学院毕业设计 图C3 实物图 第40页 共48页 附录D 源代码: #include #define uchar unsigned char #define uint unsigned int uchar code table0[]=%uchar code table1[]=\sbit lcdrs=P3^2; sbit lc

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com