做一个温度测量仪器 不知道哪里错了
时间:10-02
整理:3721RD
点击:
#include
#define uchar unsigned char
#define uint unsigned int
uchar code segcode[ ]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
uchar Temperature[ ]={0,0,0};
sbit OE=P2^7;
sbit EOC=P2^6;
sbit START=P2^5;
sbit CLK=P2^4;
sbit H_LED=P3^0;
sbit L_LED=P3^1;
sbit BEEP=P3^7;
uchar t=0;
void Deley_ms(uint x)
{
uchar i;
while(x--)
for(i=0;i 130)
{
TR1=1;
H_LED=! L_LED;
}
else
{
TR1=1;
H_LED=L_LED=1;
}
break;
}
}
}
void T0_INT() interupt 1
{
clk=~clk
}
void T1_INT() interupt 3
{
TH1=(65536-1000)/256;
TL1=(65536-1000)%256;
TL1=(65536-1000)%256;
BEEP=~BEEP;
if(L_LED==0)
{if(++t !=150)return;}
else
{if(++t !=60)return;}
t=0;
Deley_ms(20)
}
#define uchar unsigned char
#define uint unsigned int
uchar code segcode[ ]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
uchar Temperature[ ]={0,0,0};
sbit OE=P2^7;
sbit EOC=P2^6;
sbit START=P2^5;
sbit CLK=P2^4;
sbit H_LED=P3^0;
sbit L_LED=P3^1;
sbit BEEP=P3^7;
uchar t=0;
void Deley_ms(uint x)
{
uchar i;
while(x--)
for(i=0;i 130)
{
TR1=1;
H_LED=! L_LED;
}
else
{
TR1=1;
H_LED=L_LED=1;
}
break;
}
}
}
void T0_INT() interupt 1
{
clk=~clk
}
void T1_INT() interupt 3
{
TH1=(65536-1000)/256;
TL1=(65536-1000)%256;
TL1=(65536-1000)%256;
BEEP=~BEEP;
if(L_LED==0)
{if(++t !=150)return;}
else
{if(++t !=60)return;}
t=0;
Deley_ms(20)
}
