#include
#include
#include "LCD1602.h"
#include "STCEEPROM.h"
sbit RX = P2^0; //
sbit TX = P2^1;
sbit LED = P3^3; //LED
sbit SPEAK = P3^3; //
sbit Motor = P1^6; //
sbit KEY1 = P3^5; //
sbit KEY2 = P3^6; //
sbit KEY3 = P3^7; //
unsigned int time=0;//
unsigned int timer=0;//
unsigned int S=0;//
unsigned int SET_H=100,SET_L=10;//
bit flag =0; //
unsigned char Table[5],Table1[5];//
unsigned char KEY_flag=0; //
//
void Delay_ms(int jj) //
{
int ii; //
while(jj--)//n
for(ii=0;ii=7000)||flag==1) //“-”
{
flag=0; //
}
else
{
Table1[0]= S/1000+0X30; //
Table1[1]= S/100%10+0X30; //
Table1[2]= S/10%10+0X30; //
Table1[3]= '.'; //
Table1[4]= S%10+0X30; //
LCD1602_Disp_ZF(0x88,Table1,5); //
}
}
void main(void) //
{
LCD1602_init();//
//////////////////////0123456789ABCDEF
LCD1602_Disp_ZF(0x80," Now S: CM ",16);
//0123456789ABCDEF
LCD1602_Disp_ZF(0x80+0X40,"Set H L ",16);
TMOD=0x11; //T01,GATE=1;
TH0=0; //
TL0=0; //
TH1=0xf8; //2MS
TL1=0x30; //2MS
ET0=1; //T0
ET1=1; //T1
TR1=1; //
EA=1; //
EA=0;//
SET_H = ISP_READ(0x2c00)*256+ISP_READ(0x2c01);//
SET_L = ISP_READ(0x2c02)*256+ISP_READ(0x2c03);//
EA=1; //
while(1)//
{
while(!RX); //RX
TR0=1; //
while(RX); //RX1
TR0=0; //
Conut(); //
/////////////////////////////////////
if((S>SET_H)||(S=100)//100,200
{
timer=0;
TX=1; //200MS
_nop_(); _nop_(); _nop_();
_nop_(); _nop_(); _nop_();
_nop_(); _nop_(); _nop_();
_nop_(); _nop_(); _nop_();
_nop_(); _nop_(); _nop_();
_nop_(); _nop_();_nop_();
_nop_(); _nop_(); _nop_();
TX=0;
}
}