找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 962|回复: 1
打印 上一主题 下一主题
收起左侧

想知道图中几个按钮的功能

[复制链接]
跳转到指定楼层
楼主
想知道图中几个按钮的功能
#include <REGX52.H>
#define uchar unsigned char
sbit DQ=P2^0;       //&Ecirc;&yacute;&frac34;&Yacute;&acute;&laquo;&Ecirc;&auml;&Iuml;&szlig;&frac12;&Oacute;&micro;&yen;&AElig;&not;&raquo;ú&micro;&Auml;&Iuml;à&Oacute;&brvbar;&micro;&Auml;&Ograve;&yacute;&frac12;&Aring;
unsigned char tempL=0;    //&Aacute;&Ugrave;&Ecirc;±±&auml;&Aacute;&iquest;&micro;&Iacute;&Icirc;&raquo;&pound;¨&Icirc;&THORN;·&ucirc;&ordm;&Aring;×&Ouml;·&ucirc;±&auml;&Aacute;&iquest;&pound;&copy;
unsigned char tempH=0;   //&Aacute;&Ugrave;&Ecirc;±±&auml;&Aacute;&iquest;&cedil;&szlig;&Icirc;&raquo;
unsigned int tempa;      //&Icirc;&Acirc;&para;&Egrave;&Ouml;&micro;&pound;¨&Otilde;&ucirc;&ETH;&Iacute;±&auml;&Aacute;&iquest;&pound;&copy;
uchar display_data[4]={0};
void DS18_delay(int useconds)//&Ntilde;&Oacute;&Ecirc;±&ordm;&macr;&Ecirc;&yacute;
{
int s;
for (s=0; s<useconds;s++);
}
unsigned char Init_DS18B20(void)
{
unsigned char x=0;

   DQ=0;               //·&cent;&Euml;&Iacute;&cedil;&acute;&Icirc;&raquo;&Acirc;&ouml;&sup3;&aring;
   DS18_delay(29);           //&Ntilde;&Oacute;&Ecirc;±&pound;¨>480ms)
   DQ=1;             //&Agrave;&shy;&cedil;&szlig;&Ecirc;&yacute;&frac34;&Yacute;&Iuml;&szlig;
   DS18_delay(3);         //&micro;&Egrave;&acute;&yacute;&pound;¨15~60ms) &micro;&Egrave;&acute;&yacute;&acute;&aelig;&Ocirc;&Uacute;&Acirc;&ouml;&sup3;&aring;
    x=DQ;  //&raquo;&ntilde;&micro;&Atilde;&acute;&aelig;&Ocirc;&Uacute;&ETH;&Aring;&ordm;&Aring;(&Oacute;&Atilde;&Oacute;&Uacute;&Aring;&ETH;&para;&Iuml;&Ecirc;&Ccedil;·&ntilde;&Oacute;&ETH;&AElig;÷&frac14;&thorn;)
    DS18_delay(25);  // &micro;&Egrave;&acute;&yacute;&Ecirc;±&frac14;&auml;&Iuml;&para;&frac12;á&Ecirc;&oslash;
    return(x);  //·&micro;&raquo;&Oslash;&acute;&aelig;&Ocirc;&Uacute;&ETH;&Aring;&ordm;&Aring;&pound;&not;0 = &AElig;÷&frac14;&thorn;&acute;&aelig;&Ocirc;&Uacute;, 1 = &Icirc;&THORN;&AElig;÷&frac14;&thorn;
}
ReadOneChar(void)//&para;&Aacute;&Ograve;&raquo;&cedil;&ouml;×&Ouml;&frac12;&Uacute;
{
unsigned char i=0;   
unsigned char dat=0;
    for (i=8;i>0;i--)   
  {
   DQ=1;
      DS18_delay(1);
      DQ=0;      
      dat>>=1;//&cedil;&acute;&ordm;&Iuml;&cedil;&sup3;&Ouml;&micro;&Ocirc;&Euml;&Euml;&atilde;&pound;&not;&micro;&Egrave;&ETH;§dat=dat>>1(dat=dat&Oacute;&Ograve;&Ograve;&AElig;&Ograve;&raquo;&Icirc;&raquo;&ordm;ó&micro;&Auml;&Ouml;&micro;)
      DQ=1;
      if(DQ)
      dat|=0x80;
      DS18_delay(4);
  }
    return(dat);
}
WriteOneChar(unsigned char dat)//&Oacute;&ETH;&sup2;&Icirc;&ordm;&macr;&Ecirc;&yacute;&pound;&not;&sup1;&brvbar;&Auml;&Uuml;&Ecirc;&Ccedil;"&ETH;&acute;"&pound;&not;&para;&oslash;&ETH;&acute;&micro;&Auml;&Auml;&Uacute;&Egrave;&Yacute;&frac34;&Iacute;&Ecirc;&Ccedil;&Agrave;¨&ordm;&Aring;&Auml;&Uacute;&micro;&Auml;&sup2;&Icirc;&Ecirc;&yacute;
{
unsigned char i=0;   
for(i=8;i>0;i--)   
{
  DQ=0;     
  DQ=dat&0x01;
  DS18_delay(5);
  DQ=1;
  dat>>=1;//&cedil;&acute;&ordm;&Iuml;&cedil;&sup3;&Ouml;&micro;&Ocirc;&Euml;&Euml;&atilde;&pound;&not;&micro;&Egrave;&ETH;§dat=dat>>1(dat=dat&Oacute;&Ograve;&Ograve;&AElig;&Ograve;&raquo;&Icirc;&raquo;&ordm;ó&micro;&Auml;&Ouml;&micro;)
}
DS18_delay(4);
}
unsigned int ReadTemperature(void)//·&micro;&raquo;&Oslash;&para;&Aacute;&Egrave;&iexcl;&micro;&Auml;&Icirc;&Acirc;&para;&Egrave;.
{  
Init_DS18B20();   //&sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;&pound;&not;&micro;÷&Oacute;&Atilde;&sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;&ordm;&macr;&Ecirc;&yacute;
WriteOneChar(0xcc);    //&Igrave;&oslash;&sup1;&yacute;&para;&Aacute;&ETH;ò&Aacute;&ETH;&ordm;&Aring;&micro;&Auml;&sup2;&Ugrave;×÷&pound;&not;&micro;÷&Oacute;&Atilde;&ETH;&acute;&ordm;&macr;&Ecirc;&yacute;&pound;&not;&ETH;&acute;0xcc&Ouml;&cedil;&Aacute;&icirc;&Acirc;&euml;&pound;¨&Igrave;&oslash;&sup1;&yacute;&para;&Aacute;&ETH;ò&Aacute;&ETH;&ordm;&Aring;&pound;&copy;
WriteOneChar(0x44);   //&AElig;&ocirc;&para;&macr;&Icirc;&Acirc;&para;&Egrave;×&ordf;&raquo;&raquo;&pound;&not;&micro;÷&Oacute;&Atilde;&ETH;&acute;&ordm;&macr;&Ecirc;&yacute;&pound;&not;&ETH;&acute;0x44&Ouml;&cedil;&Aacute;&icirc;&Acirc;&euml;&pound;¨&AElig;&ocirc;&para;&macr;&Icirc;&Acirc;&para;&Egrave;×&ordf;&raquo;&raquo;&pound;&copy;
DS18_delay(125);       //×&ordf;&raquo;&raquo;&ETH;è&Ograve;&ordf;&Ograve;&raquo;&micro;&atilde;&Ecirc;±&frac14;&auml;&pound;&not;&Ntilde;&Oacute;&Ecirc;±
Init_DS18B20();    //&sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;&pound;&not;&micro;÷&Oacute;&Atilde;&sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;&ordm;&macr;&Ecirc;&yacute;
WriteOneChar(0xcc);    //&Igrave;&oslash;&sup1;&yacute;&para;&Aacute;&ETH;ò&Aacute;&ETH;&ordm;&Aring;&micro;&Auml;&sup2;&Ugrave;×÷&pound;&not;&micro;÷&Oacute;&Atilde;&ETH;&acute;&ordm;&macr;&Ecirc;&yacute;&pound;&not;&ETH;&acute;0xcc&Ouml;&cedil;&Aacute;&icirc;&Acirc;&euml;&pound;¨&Igrave;&oslash;&sup1;&yacute;&para;&Aacute;&ETH;ò&Aacute;&ETH;&ordm;&Aring;?
WriteOneChar(0xbe);   //&micro;÷&Oacute;&Atilde;&ETH;&acute;&ordm;&macr;&Ecirc;&yacute;&pound;&not;&ETH;&acute;0xbe&Ouml;&cedil;&Aacute;&icirc;&Acirc;&euml;&pound;&not;&para;&Aacute;&Icirc;&Acirc;&para;&Egrave;&frac14;&Auml;&acute;&aelig;&AElig;÷&pound;¨&Iacute;·&Aacute;&frac12;&cedil;&ouml;&Ouml;&micro;·&Ouml;±&eth;&Icirc;&ordf;&Icirc;&Acirc;&para;&Egrave;&micro;&Auml;&micro;&Iacute;&Icirc;&raquo;&ordm;&Iacute;&cedil;&szlig;&Icirc;&raquo;&pound;&copy;
tempL=ReadOneChar();   //&para;&Aacute;&sup3;&ouml;&Icirc;&Acirc;&para;&Egrave;&micro;&Auml;&micro;&Iacute;&Icirc;&raquo;LSB
tempH=ReadOneChar();   //&para;&Aacute;&sup3;&ouml;&Icirc;&Acirc;&para;&Egrave;&micro;&Auml;&cedil;&szlig;&Icirc;&raquo;MSB  
   tempa=((tempH*256)+tempL)*6.25;  //&Icirc;&Acirc;&para;&Egrave;×&ordf;&raquo;&raquo;,&Agrave;&copy;&acute;ó100·&micro;&raquo;&Oslash;
//DS18_delay(10);
//tempa=tempL+tempH;
return(tempa);//&Ocirc;&Euml;&Euml;&atilde;&frac12;á&sup1;&ucirc;·&micro;&raquo;&Oslash;&micro;&frac12;&ordm;&macr;&Ecirc;&yacute;
}
void display()//&Iuml;&Ocirc;&Ecirc;&frac34;&ordm;&macr;&Ecirc;&yacute;
{
  unsigned char i,j,k=0x80;
  unsigned char code dis[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x39};
  for(i=0;i<4;i++)
   {
    P2=0x0f;
    if(i==1)
     P0=dis[display_data[i]]+0x80;
    else
     P0=dis[display_data[i]];
    P2=k;
    k=k>>1;
    for(j=250;j>0;j--);
   }
   P2=0x0f;
}
void main()
{

unsigned int temp;
uchar i;
while(1)
{
  temp=ReadTemperature();
  display_data[0]=temp/1000;
  display_data[1]=(temp/100)%10;
  display_data[2]=(temp/10)%10;
  display_data[3]=temp%10;
  for(i=0;i<250;i++) display();
}
} */
# include <reg51.h>  
#define uint unsigned int
#define uchar unsigned char   //&ordm;ê&para;¨&Ograve;&aring;
sbit p34=P2^4;
sbit p35=P2^5;
sbit p36=P2^6;
sbit dp=P0^7;
sbit p37=P2^7;
sbit  DQ=P2^2;    //&para;¨&Ograve;&aring;DS18B20×&Uuml;&Iuml;&szlig;I/O
  sbit SET=P3^1;    //&para;¨&Ograve;&aring;&Ntilde;&iexcl;&Ocirc;&ntilde;±¨&micro;÷&Otilde;&ucirc;&frac34;&macr;&Icirc;&Acirc;&para;&Egrave;&Eacute;&Iuml;&Iuml;&THORN;&ordm;&Iacute;&Iuml;&Acirc;&Iuml;&THORN;&pound;¨1&Icirc;&ordf;&Eacute;&Iuml;&Iuml;&THORN;&pound;&not;0&Icirc;&ordf;&Iuml;&Acirc;&Iuml;&THORN;&pound;&copy; /****P3.2&ordm;&Iacute;P3.3&Icirc;&ordf;&micro;÷&Otilde;&ucirc;&Icirc;&Acirc;&para;&Egrave;±¨&frac34;&macr;&Ocirc;&ouml;&frac14;&Oacute;&frac14;ü&ordm;&Iacute;&frac14;&otilde;&Eacute;&Ugrave;&frac14;ü******/
sbit LING=P2^0;   //&para;¨&Ograve;&aring;&Iuml;ì&Aacute;&aring;  
signed char m;     //&Icirc;&Acirc;&para;&Egrave;&Ouml;&micro;&Egrave;&laquo;&frac34;&Ouml;±&auml;&Aacute;&iquest;
bit sign=0;     //&Iacute;&acirc;&sup2;&iquest;&Ouml;&ETH;&para;&Iuml;×&acute;&Igrave;&not;±ê&Ouml;&frac34;
signed char shangxian=38;  //&Eacute;&Iuml;&Iuml;&THORN;±¨&frac34;&macr;&Icirc;&Acirc;&para;&Egrave;&pound;&not;&Auml;&not;&Egrave;&Iuml;&Ouml;&micro;&Icirc;&ordf;38
signed char xiaxian=6;   //&Iuml;&Acirc;&Iuml;&THORN;±¨&frac34;&macr;&Icirc;&Acirc;&para;&Egrave;&pound;&not;&Auml;&not;&Egrave;&Iuml;&Ouml;&micro;&Icirc;&ordf;5
  uchar code  LEDData[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff,0xbf}; /*****&Ntilde;&Oacute;&Ecirc;±×&Oacute;&sup3;&Igrave;&ETH;ò*****/
void Delay(uint i)
{  
while( i-- );
}
void Init_DS18B20(void)
{  
  unsigned char x=0;   
    DQ=1;    Delay(8);    //&Eacute;&Ocirc;×&ouml;&Ntilde;&Oacute;&Ecirc;±
   DQ=0;         //&micro;&yen;&AElig;&not;&raquo;ú&frac12;&laquo;DQ&Agrave;&shy;&micro;&Iacute;  
Delay(80);   //&frac34;&laquo;&Egrave;·&Ntilde;&Oacute;&Ecirc;±&pound;&not;&acute;ó&Oacute;&Uacute;480us
  DQ=1;         //&Agrave;&shy;&cedil;&szlig;×&Uuml;&Iuml;&szlig;
  Delay(14);
   x=DQ;           //&Eacute;&Ocirc;×&ouml;&Ntilde;&Oacute;&Ecirc;±&ordm;ó&pound;&not;&Egrave;&ccedil;&sup1;&ucirc;x=0&Ocirc;ò&sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;&sup3;&Eacute;&sup1;&brvbar;&pound;&not;x=1&Ocirc;ò&sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;&Ecirc;§°&Uuml;  
Delay(20);
}  
/*****&para;&Aacute;&Ograve;&raquo;&cedil;&ouml;×&Ouml;&frac12;&Uacute;*****/
  unsigned char ReadOneChar(void)
{   
unsigned char i=0;
  unsigned char dat=0;
  for (i=8;i>0;i--)  
{     
DQ=0;     // &cedil;&oslash;&Acirc;&ouml;&sup3;&aring;&ETH;&Aring;&ordm;&Aring;   
  dat>>=1;   
   DQ=1;     // &cedil;&oslash;&Acirc;&ouml;&sup3;&aring;&ETH;&Aring;&ordm;&Aring;
    if(DQ)     dat|=0x80;  
   Delay(4);
  }   
return(dat); }  
/*****&ETH;&acute;&Ograve;&raquo;&cedil;&ouml;×&Ouml;&frac12;&Uacute;*****/
void WriteOneChar(unsigned char dat)
{    unsigned char i=0;
  for (i=8; i>0; i--)
  {
     DQ=0;   
   DQ=dat&0x01;  
   Delay(5);     
DQ=1;     dat>>=1;
  }
}  
void Tmpchange(void) //·&cent;&Euml;&Iacute;&Icirc;&Acirc;&para;&Egrave;×&ordf;&raquo;&raquo;&Atilde;ü&Aacute;&icirc;
{  
  Init_DS18B20();
   WriteOneChar(0xCC);  //&Igrave;&oslash;&sup1;&yacute;&para;&Aacute;&ETH;ò&ordm;&Aring;&Aacute;&ETH;&ordm;&Aring;&micro;&Auml;&sup2;&Ugrave;×÷  
WriteOneChar(0x44);  //&AElig;&ocirc;&para;&macr;&Icirc;&Acirc;&para;&Egrave;×&ordf;
   }
unsigned int ReadTemperature(void)
{   
unsigned char a=0;
  unsigned char b=0;
  unsigned int t=0;  
float tt=0;  
Tmpchange();
   Init_DS18B20();  
  WriteOneChar(0xCC);  //&Igrave;&oslash;&sup1;&yacute;&para;&Aacute;&ETH;ò&ordm;&Aring;&Aacute;&ETH;&ordm;&Aring;&micro;&Auml;&sup2;&Ugrave;×÷
  WriteOneChar(0xBE);  //&para;&Aacute;&Egrave;&iexcl;&Icirc;&Acirc;&para;&Egrave;&frac14;&Auml;&acute;&aelig;&AElig;÷  
a=ReadOneChar();     //&para;&Aacute;&micro;&Iacute;8&Icirc;&raquo;
  b=ReadOneChar();    //&para;&Aacute;&cedil;&szlig;8&Icirc;&raquo;
  t=b;   t<<=8;   t=t|a;    tt=t*0.0625;    t= tt*100+0.5;     //·&Aring;&acute;ó10±&para;&Ecirc;&auml;&sup3;&ouml;&sup2;&cent;&Euml;&Auml;&Eacute;á&Icirc;&aring;&Egrave;&euml;
  return(t); }     /*****&Iuml;&Ocirc;&Ecirc;&frac34;&iquest;&ordf;&raquo;ú&sup3;&otilde;&Ecirc;&frac14;&raquo;&macr;&micro;&Egrave;&acute;&yacute;&raquo;&shy;&Atilde;&aelig;*****/
Disp_init()     {   P0 = 0x80;      //&Iuml;&Ocirc;&Ecirc;&frac34;-
p34=1;p35=0;p36=0;p37=0;
Delay(200);
P0 = 0x80;
   p34=0;p35=1;p36=0;p37=0;
Delay(200);
  P0 = 0x80;
    p34=0;p35=0;p36=1;p37=0;
Delay(200);
  P0 = 0x80;
   p34=0;p35=0;p36=0;p37=1;
Delay(200);
  P0 = 0x80;
  }  
Disp_Temperature()     //&Iuml;&Ocirc;&Ecirc;&frac34;&Icirc;&Acirc;&para;&Egrave;
{   uint a,b,c,d,e;  
e=ReadTemperature();  //&raquo;&ntilde;&Egrave;&iexcl;&Icirc;&Acirc;&para;&Egrave;&Ouml;&micro;
  a=e/1000;             //&frac14;&AElig;&Euml;&atilde;&micro;&Atilde;&micro;&frac12;&Ecirc;&reg;&Icirc;&raquo;&Ecirc;&yacute;
b=e/100-a*10;         //&frac14;&AElig;&Euml;&atilde;&micro;&Atilde;&micro;&frac12;&cedil;&ouml;&Icirc;&raquo;&Ecirc;&yacute;×&Ouml;  
d=e%10;               //&frac14;&AElig;&Euml;&atilde;&micro;&Atilde;&micro;&frac12;&ETH;&iexcl;&Ecirc;&yacute;&micro;&atilde;&ordm;ó&Aacute;&frac12;&Icirc;&raquo;
c=(e%100)/10;         //&frac14;&AElig;&Euml;&atilde;&micro;&Atilde;&micro;&frac12;&ETH;&iexcl;&Ecirc;&yacute;&micro;&atilde;&ordm;ó&Ograve;&raquo;&Icirc;&raquo;
m=e/100;  
if(m>shangxian || m<xiaxian) LING=1;  //&Icirc;&Acirc;&para;&Egrave;&sup2;&raquo;&Ocirc;&Uacute;·&para;&Icirc;§&Auml;&Uacute;±¨&frac34;&macr;  
else LING=0;  p34=0;p35=0;p36=0;p37=0;   
  P0 =LEDData[d];   //&Iuml;&Ocirc;&Ecirc;&frac34;&ETH;&iexcl;&Ecirc;&yacute;&micro;&atilde;&ordm;ó&Aacute;&frac12;&Icirc;&raquo;  
  p34=1;p35=0;p36=0;p37=0;      
  Delay(300);  p34=0;p35=0;p36=0;p37=0;   
P0 =LEDData[c];    //&Iuml;&Ocirc;&Ecirc;&frac34;&ETH;&iexcl;&Ecirc;&yacute;&micro;&atilde;&ordm;ó&Ograve;&raquo;&Icirc;&raquo;
p34=0;p35=1;p36=0;p37=0;
Delay(300);
p34=0;p35=0;p36=0;p37=0;   
P0 =LEDData[b];    //&Iuml;&Ocirc;&Ecirc;&frac34;&cedil;&ouml;&Icirc;&raquo;
dp=0;  p34=0;p35=0;p36=1;p37=0;
Delay(300);  p34=0;p35=0;p36=0;p37=0;  
  P0 =LEDData[a];    //&Iuml;&Ocirc;&Ecirc;&frac34;&Ecirc;&reg;&Icirc;&raquo;
p34=0;p35=0;p36=0;p37=1;  
Delay(300);  p34=0;p35=0;p36=0;p37=0;        //&sup1;&Oslash;±&Otilde;&Iuml;&Ocirc;&Ecirc;&frac34;
}  
disptiaozheng()  
{   
uchar f,g,j,k;  
f=shangxian/10;  
g=shangxian%10;  
j=xiaxian/10;  
k=xiaxian%10;  
p34=0;p35=0;p36=0;p37=0;
    P0 =0xc0;          //&Iuml;&Ocirc;&Ecirc;&frac34;0 p34=1;p35=0;p36=0;p37=0;
Delay(200);  p34=0;p35=0;p36=0;p37=0;   P0 =0xc0;          //&Iuml;&Ocirc;&Ecirc;&frac34;0
p34=0;p35=1;p36=0;p37=0;
Delay(200);  p34=0;p35=0;p36=0;p37=0;  
if(SET==1)
{  
P0 =LEDData[g];
  dp=0;   //&Iuml;&Ocirc;&Ecirc;&frac34;&Eacute;&Iuml;&Iuml;&THORN;&Icirc;&Acirc;&para;&Egrave;&cedil;&ouml;&Icirc;&raquo;
    }  
else
{
P0 =LEDData[k];
  dp=0;
  }
p34=0;p35=0;p36=1;p37=0;
  Delay(200);  p34=0;p35=0;p36=0;p37=0;
   if(SET==1) P0 =LEDData[f];   //&Iuml;&Ocirc;&Ecirc;&frac34;&Eacute;&Iuml;&Iuml;&THORN;&Icirc;&Acirc;&para;&Egrave;&Ecirc;&reg;&Icirc;&raquo;
else    {    if(f==0) P0=0x00;     //&sup2;&raquo;&Iuml;&Ocirc;&Ecirc;&frac34;&Iuml;&Acirc;&Iuml;&THORN;&Icirc;&Acirc;&para;&Egrave;&Ecirc;&reg;&Icirc;&raquo;
  else P0 =LEDData[j];  //&Iuml;&Ocirc;&Ecirc;&frac34;&Iuml;&Acirc;&Iuml;&THORN;&Icirc;&Acirc;&para;&Egrave;&Ecirc;&reg;&Icirc;&raquo;
  }  p34=0;p35=0;p36=0;p37=1;
Delay(200);
  p34=0;p35=0;p36=0;p37=0;          //&sup1;&Oslash;±&Otilde;&Iuml;&Ocirc;&Ecirc;&frac34;
Delay(20);  
}   
void int0(void) interrupt 0 {     EX0=0;      //&sup1;&Oslash;&Iacute;&acirc;&sup2;&iquest;&Ouml;&ETH;&para;&Iuml;0
sign=1;  
if(SET==1) shangxian++;  else xiaxian++;
  Delay(500);  EX0=1;
}   /*****&Iacute;&acirc;&sup2;&iquest;&Ouml;&ETH;&para;&Iuml;1·&thorn;&Icirc;&ntilde;&sup3;&Igrave;&ETH;ò*****/
void int1(void)
interrupt 2
{   
EX1=0;      //&sup1;&Oslash;&Iacute;&acirc;&sup2;&iquest;&Ouml;&ETH;&para;&Iuml;0
sign=1;   if(SET==1) shangxian--;
else xiaxian--;  Delay(500);  EX1=1;
  }   /*****&Ouml;÷&ordm;&macr;&Ecirc;&yacute;*****/
void main(void)
{   
uint z;
IT0=1;  
IT1=1;
  EX0=1;
  EX1=1;
  EA=1;
   ReadTemperature();
  LING=0;   
for(z=0;z<100;z++)
  {   
Disp_init();     
      }
while(1)  
{      
Disp_Temperature();  
if(sign==1)  
{  
for(z=0;z<300;z++)  
  disptiaozheng();
  sign=0;  
}  
}
}

6.png (84.1 KB, 下载次数: 39)

6.png
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:261288 发表于 2018-6-27 16:34 | 只看该作者
接R1电阻的按钮是复位;P3^1口的是温度调整;P3^2口的是加键;P3^3口是减键。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表