基于单片机室内有害气体监测系统
1475下载地址 https://docs.qq.com/doc/DWEpnR2pOWU91b3p4?pub=1&dver=2.1.0
#include<reg52.h> #include <intrins.h> #define ulong unsigned long #define uchar unsigned char #define uint unsigned int #define LCD1602_PORT P1 #define PCF8591 0x90 #define NOP() _nop_() #define _Nop() _nop_() sbit SCL=P2^1; sbit SDA=P2^0; sbit LCD1602_RS = P2^5; sbit LCD1602_RW = P2^4; sbit LCD1602_EN = P2^3; bit ack; sbit key1= P0^4; sbit key2 = P0^5; sbit buzz = P2^6; int g=50; void delay_ms(uint n) { unsigned int i,j; for(i=0;i<n;i++) for(j=0;j<123;j++);