• subezhj
    了解作者
  • C/C++
    开发工具
  • 11KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 2
    下载次数
  • 2019-11-11 10:28
    上传日期
多个ds18b20的识别与读取,采用了读取1位,2位的方式获取id号,并分类
ds18b20.zip
  • 多个ds18b20自动身份识别并读取温度实用程序.pdf
    13.3KB
  • 多个ds18b20自动身份识别并读取温度实用程序.txt
    6.6KB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/6264c3ef4c65f41259f42ed7/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/6264c3ef4c65f41259f42ed7/bg1.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">&#31243;&#24207;&#20171;&#32461;&#65306;&#26412;&#31243;&#24207;&#20026;&#21333;&#24635;&#32447;&#19978;&#22810;&#20010;<span class="_ _0"> </span><span class="ff2">ds18b20<span class="_ _1"> </span></span>&#28201;&#24230;&#20256;&#24863;&#22120;&#33258;&#21160;&#35835;&#21462;&#36523;&#20221;<span class="_ _2"> </span><span class="ff2">ID<span class="_ _3"> </span></span>&#24182;&#20445;&#23384;&#65292;&#28982;&#21518;&#22312;&#26174;</div><div class="t m0 x1 h2 y2 ff1 fs0 fc0 sc0 ls0 ws0">&#31034;&#23631;&#19978;&#20998;&#21035;&#26174;&#31034;&#28201;&#24230;&#31243;&#24207;&#65292;&#20197;&#29992;<span class="_ _4"> </span><span class="ff2">3<span class="_ _5"> </span></span>&#20010;<span class="_ _3"> </span><span class="ff2">18b20<span class="_ _1"> </span></span>&#27979;&#35797;&#36807;&#65292;&#21487;&#25191;&#34892;&#31243;&#24207;&#12290;</div><div class="t m0 x1 h2 y3 ff1 fs0 fc0 sc0 ls0 ws0">&#31243;&#24207;&#20869;&#23481;&#65306;</div><div class="t m0 x1 h3 y4 ff2 fs0 fc0 sc0 ls0 ws0">#include &lt;reg52.h&gt; </div><div class="t m0 x1 h3 y5 ff2 fs0 fc0 sc0 ls0 ws0">#include &lt;intrins.h&gt; </div><div class="t m0 x1 h2 y6 ff2 fs0 fc0 sc0 ls0 ws0">#define uchar unsigned char //<span class="_ _6"> </span><span class="ff1">&#23450;&#20041;&#26080;&#31526;&#21495;&#21333;&#23383;&#33410;</span></div><div class="t m0 x1 h2 y7 ff2 fs0 fc0 sc0 ls0 ws0">#define uint unsigned int <span class="_ _7"> </span>//<span class="_ _5"> </span><span class="ff1">&#23450;&#20041;&#26080;&#31526;&#21495;&#25972;&#24418;</span></div><div class="t m0 x1 h2 y8 ff2 fs0 fc0 sc0 ls0 ws0">#define MAXNUM 5 <span class="_ _8"> </span>//<span class="_ _1"> </span><span class="ff1">&#23450;&#20041;&#26368;&#22810;<span class="_ _9"> </span></span>DS18B20<span class="_ _a"></span><span class="ff1">&#20010;&#25968;<span class="_ _b"> </span>&#36229;&#36807;&#30340;&#26080;&#27861;&#26174;&#31034;</span></div><div class="t m0 x1 h2 y9 ff2 fs0 fc0 sc0 ls0 ws0">sbit DQ=P3^7; <span class="_ _c"> </span>//<span class="_ _5"> </span><span class="ff1">&#23450;&#20041;&#25968;&#25454;&#32447;</span></div><div class="t m0 x1 h3 ya ff2 fs0 fc0 sc0 ls0 ws0">sbit RS=P3^0; </div><div class="t m0 x1 h3 yb ff2 fs0 fc0 sc0 ls0 ws0">sbit RW=P3^1; </div><div class="t m0 x1 h3 yc ff2 fs0 fc0 sc0 ls0 ws0">sbit E=P3^2; </div><div class="t m0 x1 h3 yd ff2 fs0 fc0 sc0 ls0 ws0">uchar code lcd0[]={"SEARCH ROMING..."}; </div><div class="t m0 x1 h3 ye ff2 fs0 fc0 sc0 ls0 ws0">uchar code lcd1[]={"SEARCH ROM OK!"}; </div><div class="t m0 x1 h3 yf ff2 fs0 fc0 sc0 ls0 ws0">uchar code lcd2[]={"The total is:"}; </div><div class="t m0 x1 h3 y10 ff2 fs0 fc0 sc0 ls0 ws0">uchar code lcd3[]={"No.( ):"}; </div><div class="t m0 x1 h3 y11 ff2 fs0 fc0 sc0 ls0 ws0">uchar code lcd4[]={'0','1','2','3','4','5','6','7','8','9','.',0xdf,0x43}; </div><div class="t m0 x1 h3 y12 ff2 fs0 fc0 sc0 ls0 ws0">uchar dat[6]; </div><div class="t m0 x1 h3 y13 ff2 fs0 fc0 sc0 ls0 ws0">uchar temp_l,temp_h,is_fuwen,temp_x,temp_over,t; </div><div class="t m0 x1 h3 y14 ff2 fs0 fc0 sc0 ls0 ws0">uchar num=0; </div><div class="t m0 x1 h3 y15 ff2 fs0 fc0 sc0 ls0 ws0">uint i; </div><div class="t m0 x1 h3 y16 ff2 fs0 fc0 sc0 ls0 ws0">uchar al[MAXNUM]; </div><div class="t m0 x1 h3 y17 ff2 fs0 fc0 sc0 ls0 ws0">idata uchar ID[MAXNUM][8]; // <span class="_ _d"> </span>={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} </div><div class="t m0 x1 h3 y18 ff2 fs0 fc0 sc0 ls0 ws0">void alarm_search(void); </div><div class="t m0 x1 h2 y19 ff2 fs0 fc0 sc0 ls0 ws0">/***********************<span class="_ _e"> </span><span class="ff1">&#28082;&#26230;&#27169;&#22359;<span class="_ _f"> </span></span>**********************************/ </div><div class="t m0 x1 h2 y1a ff2 fs0 fc0 sc0 ls0 ws0">void delay()//<span class="_ _f"> </span><span class="ff1">&#24310;&#26102;&#31243;&#24207;</span></div><div class="t m0 x1 h3 y1b ff2 fs0 fc0 sc0 ls0 ws0">{ </div><div class="t m0 x2 h3 y1c ff2 fs0 fc0 sc0 ls0 ws0">uchar y; </div><div class="t m0 x2 h3 y1d ff2 fs0 fc0 sc0 ls0 ws0">for(y=0;y&lt;250;y++); </div><div class="t m0 x1 h3 y1e ff2 fs0 fc0 sc0 ls0 ws0">} </div><div class="t m0 x1 h2 y1f ff2 fs0 fc0 sc0 ls0 ws0">void LCD_write_com(uchar com)//<span class="_ _10"> </span><span class="ff1">&#20889;</span></div><div class="t m0 x1 h3 y20 ff2 fs0 fc0 sc0 ls0 ws0">{ </div><div class="t m0 x2 h3 y21 ff2 fs0 fc0 sc0 ls0 ws0">delay(); </div><div class="t m0 x2 h3 y22 ff2 fs0 fc0 sc0 ls0 ws0">RS=0; </div><div class="t m0 x2 h3 y23 ff2 fs0 fc0 sc0 ls0 ws0">RW=0; </div><div class="t m0 x2 h3 y24 ff2 fs0 fc0 sc0 ls0 ws0">E=0; </div><div class="t m0 x2 h3 y25 ff2 fs0 fc0 sc0 ls0 ws0">E=1; </div><div class="t m0 x2 h3 y26 ff2 fs0 fc0 sc0 ls0 ws0">P0=com; </div><div class="t m0 x2 h3 y27 ff2 fs0 fc0 sc0 ls0 ws0">E=0; </div></div><div class="pi" data-data='{"ctm":[1.002956,0.000000,0.000000,1.002956,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐
    • DS18B20-gsm.rar
      DS18B20采集温度,MC35模块将温度传输到手机
    • DS18B20.zip
      通讯采集DS18B20温度,通过数码管显
    • DS18B20PLCD1602.zip
      基于DS18B20的温度显示系统,LCD做显示屏
    • ds18b20.rar
      可一次性读取多个DS18B20传感器的值 二叉树自动查找DS18B20ROM序列 在S3C6410上测试过,完全没问题
    • DS18B20 多传感器组网
      直接参考官网给的驱动代码,含单总线获取总线上所有传感器的ROM码。 proteus+AT89C51,可以正常运行,可以读取ROM码,完善的驱动程序
    • ds18b20 温度单片机程序
      史上最全ds18b20资料 以及自己写的整数、一位、两位、四位温度显示ds18b20 温度 单片机 程序
    • linux ds18b20 driver
      Linux下驱动程序编写,ds18b0温度驱动程序
    • 读取DS18B20ID号
      读取单个DS18B20id号,通过串口送给电脑显示。波特率4800。单片机晶振12MHz,单片机使用的是STC89C52。
    • DS18B20 ID号搜索函数(C#)
      本函数实现了通过电脑串口直接搜索DS18B20测温元件的ID号的功能,采用C#语言编写。
    • Proteus7.12.rar
      Proteus7.12完美破解版.rar电路仿真软件很好用可以仿真单片数字模拟电路