【资源下载】下载地址如下1527:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
可以检测温湿度,温度检测分别用PT100热敏温度传感器和ds18b20作为温度检测传感器。
#include<reg51.h>
#include <intrins.h>
#include <math.h> //Keil library
#include <stdio.h> //Keil library
#define unchar unsigned char
#define unint unsigned int
#define port P1 //LCD12864的8位数据口
typedef union //定义共同类型
{ unsigned int i; //i表示测量得到的温湿度数据(int 形式保存的数据)
unsigned char c;
float f; //f表示测量得到的温湿度数据(float 形式保存的数据)
} value;
/******************************************12864函数声明******************************************/
void delay_12864(); //延时函数
void check_busy(); //检查是否“忙”
void write_cmd(unchar cmd); //给LCD12864写命令。
void set_page(unchar page); //设置显示的“页”。
void set_line(unchar