单片机温度监控系统的设计 第2页
RC0=0;
RC1=0;
}while(1);
}
#include <pic.h>
#include "tranpc.h"
//*********************
union adres
{
int y1;
unsigned char adre[2];
}adresult;
extern unsigned int delay;
unsigned int temp;
unsigned int y;
unsigned char receive;
unsigned char a;
extern unsigned char rxbuf[];
unsigned char temph;
unsigned char templ;
extern unsigned char i;
//******************************
void PROCDIANPIN()
{
ADCON0=0X89;
ADCON1=0X84;
ADIF=0;
ADGO=1;
for(delay=0x8ff;delay>0;delay--) asm("nop");
while(ADIF==0)
{
asm("clrwdt");
}
asm("clrwdt");
ADIF=0;
adresult.adre[0]=ADRESL;
adresult.adre[1]=ADRESH;
if((adresult.y1<=0x204)&&(adresult.y1>=0xD9))
{
temp=0x10;
for(
y=0x204;adresult.y1<=y;adresult.y1=adresult.y1+0x07)
{
temp++;
if(temp==0x1a) temp=0x20;
if(temp==0x2a) temp=0x30;
www.751com.cn }
}
TXPC(temp);
RC0=1;
RXDATAS();
if(rxbuf[0]!=0)
{
if((rxbuf[0]==0x10)&&(rxbuf[1]==0xff)) receive=0xff;
else if(rxbuf[0]==0x20)
{
templ=rxbuf[1];
temph=rxbuf[2];
}
if(receive==0xff)
{
RC1=1;
a=0xff;
}
}
if(temp<=templ)
{
if(a!=0xff)
RD0=1;
else RD0=0;
}
else if(temp>=temph)
{上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>
单片机温度监控系统的设计 第2页下载如图片无法显示或论文不完整,请联系qq752018766