关于#单片机#的问题:就是这段代码是可以实现单片机外部中断1的,执行一次流水灯闪烁呢#include <stc15.h>(语言-c语言)

就是这段代码是可以实现单片机外部中断1的,按一下往左移一位
但如何把他改成按一下,执行一次流水灯闪烁呢


#include <stc15.h>
#include <intrins.h>

unsigned char i = 0x01;

void Delay1000ms()        //@11.0592MHz
{
    unsigned char i, j, k;

    _nop_();
    _nop_();
    i = 43;
    j = 6;
    k = 203;
    do
    {
        do
        {
            while (--k);
        } while (--j);
    } while (--i);
}


void int0_LED() interrupt 2
{
    i = _crol_(i,1);
    P0 =i;
    Delay1000ms();
}

void main()
{
    P0 = 0x01;
    EA = 1;
    EX1 = 1;
    IT1 =1;
    while(1);
}

在中断服务函数里面添加一个灯灭的语句。中断里面最好不要调用延时