#include
#define uchar unsigned char
uchar num,temp,times,led;
t0isr() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
times++;
if(times>=10)
{
times=0;
P0=led;
if(key1==0){
num++;
num&=0x07;
}
else if(key2==0)
{
if(num>0)num--;
else(num=7;
}
led>>=num;
}
}
main()
{
TMOD=0x01;
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
TR0=1;
ET0=1;
EA=1;
LED=0x0xfe;
num=0;
times=0;
while(1);
}
可以用外部中断吗