#include
#define uint unsigned int
#define uchar unsigned char
sbit dula=P2^0;
sbit wela=P2^1;
sbit zdrk= P3^2;
sbit d1=P1^3;
uchar num;
uchar code table[]={
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x82,0xf8,
0x80,0x90,0x88,0x83,
0xc6,0xa1,0x84,0x8e};
void delay(uint);
void main()
{
EA=1;
EX0=1;
IT0=1;
wela=1;
P1=0x55;
wela=0;
while(1)
{
for(num=0;num<16;num++)
{
dula=1;
P1=table[num];
dula=0;
delay(100);
}
P1=0xff;
delay(500);
zdrk=0;
}
}
void delay(uint z)
{
uint x,y;
for(x=110;x>0;x--)
for(y=z;y>0;y--);
}
void exter0 () interrupt 0
{
d1=0;
}
小弟刚学的单片机,请问我的程序中断部分为什么执行不了?
回答于 · 2022-07-27 01:57