DS18B20温度传感器实现实时温度测量

1个回答

  • //

    void Delayus(uchar us);

    //void Dog(void);

    bit Ds18b20_Init(void); //DS18B20初始化,存在返0,否则返1

    void Ds18b20_WriteBit(bit bitdata); //写bit2DS18B20

    void Ds18b20_WriteByte(uchar chrdata); //写Byte DS18B20

    void Ds18b20_Write(uchar *p_readdata, uchar bytes); //写 DS18B20

    bit Ds18b20_ReadBit(void); //读bit From DS18B20

    uchar Ds18b20_ReadByte(void); //读Byte DS18B20

    bit Ds18b20_ReadRom(uchar *p_readdata); //读 DS18B20 ROM:成功返0,失败返1

    bit Ds18b20_ReadEE(uchar *p_readdata); //读 DS18B20 EE :成功返0,失败返1

    bit TempCal(float *p_wendu); //成功返0,失败返1 (温度范围-55 --- +128)