sensorlib.h
来自「一个数字温度计源代码 MCU是AT89S52 温度传感器是DS18B20 」· C头文件 代码 · 共 55 行
H
55 行
//this file include the method provide by the sensorLib.c file
//Author:Decell.Zhou
//Version
#include "REG52.h"
#include "INTRINS.h"
//ROM Commands
#define SEARCH_ROM 0xf0
#define READ_ROM 0x33
#define MARCH_ROM 0x55
#define SKIP_ROM 0xcc
#define ALARM_SEARCH 0xec
//Function Commands
#define CONVERT_T 0x44
#define WRITE_RAM 0x4e
#define READ_RAM 0xbe
#define COPY_RAM 0x48
#define RECALL_E2 0xb8
#define READ_PWR 0xb4
//the DQ pin output
sbit sensorDQ = P3^7;
//===========[writeSensor]============
//Description:write a byte to the DS18B20
//Author:Decell.Zhou
//Version:
//Arg: value | unsigned char | the vaule you want to send to DS18B20
//Return:none
//==================================
void writeSensor(unsigned char value);
//==========[readSensor]==============
//Description:read a value from the DS18B20
//Author:Decell.Zhou
//Version:
//Arg:none
//Return:the byte read read from the sensor | unsigned char
//===================================
unsigned char readSensor(void);
//==========[resetSensor]=============
//Description:generate a reset signal to the Sensor
//Author:Decell.Zhou
//Version;
//Arg:none
//Return:none
//====================================
void resetSensor(void);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?