第一次代码优化,增加温度显示功能。

This commit is contained in:
Andy0613
2026-07-07 09:09:27 +08:00
parent 90b9918dc2
commit 971abf1cd8
13 changed files with 4412 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
#ifndef __DS18B20_H_
#define __DS18B20_H_
#include<reg51.h>
#include<intrins.h>
#ifndef uchar
#define uchar unsigned char
#endif
#ifndef uint
#define uint unsigned int
#endif
sbit DS18B20_DQ = P3^7;
void DS18B20_Reset(void);
void DS18B20_WriteByte(uchar dat);
uchar DS18B20_ReadByte(void);
void DS18B20_StartConvert(void);
bit DS18B20_GetTemp(int *temp);
void DS18B20_SetResolution(uchar res);
#endif