温度计的程序.doc
温度计的程序,基于c8051.#include #define uchar unsigned char typedef unsigned char unchar; typedef unsigned int unint; Init_DS18B20(void) //DS18B20温控芯片初始化 { unchar x = 0; DQ = 1; //DQ复位信号 CDelay(8); //延时 DQ = 0; //将DQ电平拉低 CDelay(80); //延时大于480us DQ = 1;