AT89C51
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit LED = P0^0;
void mian()
{
LED = 1;
EA =1;
EX0 = 1;
TCON = 0x01; //高电平到低电平跳变
while(1);
}
void External_Interrupt_0() interrupt 0
{
LED = ~LED;
}
运行此程序后,LED 总是循环闪,是什么原因啊?有个开关连的INT0管脚,但我并有按下那个开关啊。