这是个单片机中断程序,为什么执行的时候会自动跳出中断去执行主程序?
#include<reg51.h>#include<intrins.h>charcodea[]={~0x3f,~0x06,~0x5b,~0x4f,~0x66,~0x6d,...
#include <reg51.h>
#include <intrins.h>
char code a[]={~0x3f,~0x06,~0x5b,~0x4f,~0x66,~0x6d,~0x7d,~0x07,~0x7f,~0x6f,~0x77,~0x7c,~0x39,~0x5e,~0x79,~0x71};
signed int i,b=0;
char j;
sbit d1=P2^7;
void delay(unsigned int i)
{
char j;
for(i; i > 0; i--)
for(j = 100; j > 0; j--);
}
main()
{
EA=1;
EX0=1;
while(1)
{
for(i=0;i<16;i++)
{
P0=a[b];
delay(2000);
b=b+1;
}
i=0;b=0;
}
}
void exter0() interrupt 0
{
d1=0;
} 展开
#include <intrins.h>
char code a[]={~0x3f,~0x06,~0x5b,~0x4f,~0x66,~0x6d,~0x7d,~0x07,~0x7f,~0x6f,~0x77,~0x7c,~0x39,~0x5e,~0x79,~0x71};
signed int i,b=0;
char j;
sbit d1=P2^7;
void delay(unsigned int i)
{
char j;
for(i; i > 0; i--)
for(j = 100; j > 0; j--);
}
main()
{
EA=1;
EX0=1;
while(1)
{
for(i=0;i<16;i++)
{
P0=a[b];
delay(2000);
b=b+1;
}
i=0;b=0;
}
}
void exter0() interrupt 0
{
d1=0;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询