监测空气质量, LCD1602显示当前空气PM2.5
【资源下载】下载地址如下(919):https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
#include "delay.h"
#include "dht11.h"
void time_init();
void PM25_void();
uint flag_300ms ;
void main()
{
uint PM_AD_buf=0;
uint PM_AD_dat=0;
uint AD_dat1=0;
float PM_js=0.0;
bit flag1=0;
time_init();//定时器初始化
init_1602();//lcd1602初始化
while(1)
{
flag_300ms ++;
if(flag_300ms >= 300)
{
flag_300ms = 0;
PM25_void();
write_sfm_pm(1,6,pm) ; //显示PM
write_sfm_pm(2,2,U8T_data_H);