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.

CC2530 芯片问题



P1_0端口为检查端,检查传感器的高低电平,为什么我运行到 P1DIR &= (~0x1);//输入时P1_0为高电平,传感器一直位低电平为低电平,当运行到 if(!P1_0){P1_4 = 0; },P1_0又会自动为高电平,为什么。

#include "ioCC2530.h"

void main(void)
{
  //P1SEL &= (~0X01);
  P1SEL &= 0x00;
  P1DIR &= (~0x1);//输入

  P1DIR = 0X10;

  while(1)
  {
    if(P1_0)
    {
       P1_4 = 1;
    }
    if(!P1_0)
    {
      P1_4 = 0;
    }
  }
}