#include<reg51.h>
sbit P3_2=P3^2;
sbit P3_3=P3^3;
char led[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
char i=0,t=0;
inter0()interrupt 2{
TR0=!TR0;
TR0=1;
}
int0_srv()interrupt 0{
i=0;
t=0;
P0=led[0];
P2=led[0];
TR0=1;
}
void timer0()interrupt 1{
i++;
if(i==20){
i=0;
t++;
}
if(t==60)t=0;
P0=led[t/10];
P2=led[t%10];
TH0=0x3c;
TL0=0xb0;
}
void main(void){
TMOD=0x01;
TH0=0x3c;
P0=led[t/10];
P2=led[t%10];
IT0=1;
IT1=1;
EX0=1;
EX1=1;
ET0=1;
EA=1;
TR0=1;
while(1);
}
这是我的程序
开关clrar打错了- -是clean