头程序
#include <intrins.h>
#include <stdlib.h>
#include <absacc.h>
#include <string.h>
#include <reg51.h>
#include <lcd1602.c>
#define uchar unsigned char
#define uint unsigned int
#define Measure_TEMP 0x03 //温度
#define Measure_HUMI 0x05 //湿度
unsigned char T_End;
unsigned char H_End;
sfr WDT_CONTR = 0xc1;
sfr P4= 0xc0;
uchar LCD_DSY1[] = " wendu ";
uchar LCD_DSY2[] = " shidu ";
sbit TH_CLK = P1^1;
sbit TH_DAT = P1^2;
sbit Bee=P2^4;
sbit High=P2^5;
sbit Low=P2^6;
unsigned char TH_Array[3];
bit Error;
错误地方程序
void main()
{
uint m=0,p=0,q=0,n=0;
TMOD=0x02;
TH0=0x01 ;
TL0=0x01;
ET0=1;
EA=1;
while(1)
{
Calc_SHT75();
m=T_End;
n=H_End;
if(T_End>50)
{
Bee=~Bee;
High=~High;
}
LCD_DSY1[6]=m/100+'0';
LCD_DSY1[7]=m/10%10+'0';
LCD_DSY1[8]=m%10+'0';
LCD_DSY2[6]=n/100+'0';
LCD_DSY2[7]=n/10%10+'0';
LCD_DSY2[8]=n%10+'0';
Initialize_LCD1602();
LCD1602_Display(0,0, LCD_DSY1);
LCD1602_Display(0,1, LCD_DSY2);
}
}
void warming() interrupt 1
{
Bee=~Bee;
}