This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

P1_6引脚拉低之后识别不出来



我做了个小测试,将P1_6拉低和置高,用LED作为指示,但发现当P1_6为低电平时系统识别不出来

下面是我的测试程序:

void led_init()//led 初始化
{
P2DIR|=0X01;//LED
led=0;
P1DIR=0X0F;//P1_6

//P1=0XFF;

}

void main()
{
led_init();
while(1)
{
if(P1_6==0)
led=0;
else
led=1;
}
}

通过 断点发现根本没有进入低电平的程序。

请问各位大神,这是怎么回事啊?