【资源下载】百度网盘下载地址如下:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
#include <reg52.h> #include <intrins.h> #define uint unsigned int #define uchar unsigned char //宏定义 sbit RS=P1^6;//液晶接口 sbit EN=P1^7; sbit LED = P2^0;//粉尘传感器控制接口 sbit ADCS = P3^7;//AD0832接口 sbit ADCLK =P3^5; sbit ADDI = P3^6; sbit ADDO = P3^6; sbit SET= P1^1;//按键接口 sbit ADD= P1^2; sbit DEC= P1^3; sbit BEEP=P2^1;//蜂鸣器接口 uchar set_st; uchar tab[5]; uint DUST_SET=150; //固体颗粒的阈值 //bit shanshuo_st; //闪烁间隔标志 bit beep_st; //蜂鸣器间隔标志 uchar x=4; //计数器 //定义标识 uchar FlagStart = 0; float DUST_Value; uint DUST; uchar num=0; uchar mm; uchar abc; uchar ADC_Get[10]={0}; //定义AD采样数组 uchar str[5]={0}; /*****初始化定时器0*****/ void InitTimer(void)