ds18b20学习及例程详解.pptVIP

  • 35
  • 0
  • 约8.84千字
  • 约 64页
  • 2021-12-05 发布于广东
  • 举报
//***************************************向ds18b20发送温度转换指令 void sendchangecmd() { dsinit(); //初始化ds18b20 dswait(); //等待da18b20回应 writebyte(0xcc); //skip rom cmd writebyte(0x44); //convert T cmd } 2021/11/21 * //****************************************向ds18b20读取数据命令 void sendreadcmd() { dsinit(); dswait(); writebyte(0xcc); //skip rom cmd writebyte(0xbe); //read scratchpad cmd } 2021/11/21 * //****************************************获取当前温度 int gettmpvalue() { uint tmpvalue; int value; float t; uchar low,high; sendreadcmd(); //读取两个字节温度数据 low = readbyte(); high = re

文档评论(0)

1亿VIP精品文档

相关文档