void handler1() interrupt 2
{
bit N;
COUNT++;
N = ~N ;
if(N)
P1 = (0xff<<(K+1))|turnon[K]; //灯亮
else
P1 = 0xff ; //灯灭
if(COUNT==20) //闪烁10次
{
COUNT = 0 ;
K++;
if(K==8) //8个灯循环
K = 0 ;
}
}
void main()
{
P1 = 0xff ; //初始灯状态为关闭
COUNT = 0 ;
K = 0 ;
IT1 = 1; //INIT1中断为下降沿触发
while(1)