第三次优化代码,增加支持keil4的注释,此外优化LCD1602显示

This commit is contained in:
Andy0613
2026-07-07 09:15:23 +08:00
parent 6c23af74d4
commit eb0ae8ee8a
13 changed files with 4976 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#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
/* DS18B20数据线引脚定义 */
sbit DS18B20_DQ = P3^7;
/* 函数声明 */
void DS18B20_Reset(void); /* 复位DS18B20 */
void DS18B20_WriteByte(uchar dat); /* 写入一个字节 */
uchar DS18B20_ReadByte(void); /* 读取一个字节 */
void DS18B20_StartConvert(void); /* 启动温度转换 */
bit DS18B20_GetTemp(int *temp); /* 读取温度值 */
void DS18B20_SetResolution(uchar res); /* 设置分辨率 */
#endif