AM23XX温湿度传感器库函数
代码说明:
51单片机温湿度传感器库函数#include "reg52.h"#include //用户根据自己的晶振修改相应值#define FOSC 12000000#define BAUD 9600 //读传感器 端口位定义,可修改sbit Sensor_SDA = P0^0;sbit Sensor_SCL = P0^1;// 变量定义unsigned char Sensor_Data[5]={0x00,0x00,0x00,0x00,0x00};unsigned char Sensor_Check; //校验和unsigned char Sensor_AnswerFlag; //收到起始标志位unsigned char Sensor_ErrorFlag; //读取传感器错误标志unsigned int Sys_CNT;unsigned int Tmp;unsigned char *String;//字符串定义#define S_Temp "Temp:"#define S_RH "RH:"#define S_CRCT "Check: True"#define S_CRCF "Check: Wrong"#define S_Data "Data: "#define S_NotS "Sens
下载说明:请别用迅雷下载,失败请重下,重下不扣分!