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.

CC3200 GPIO的input输入获取不到结果

Other Parts Discussed in Thread: CC3200

想使用GPIO的input读取光敏电阻传感器的DO输出的高低电平,然后通过灯来观察是否读取到,但是始中无现象。

//control the input
void ReadDeviceConfiguration()
 {
     unsigned int uiGPIOPort;
     unsigned char pucGPIOPin;
     unsigned char ucPinValue;

     GPIO_IF_LedOff(MCU_ALL_LED_IND);

     while(1){
         //Read PIN1 ucPinValue
     GPIO_IF_GetPortNPin(GPIOIN,&uiGPIOPort,&pucGPIOPin);
     ucPinValue = GPIO_IF_Get(GPIOIN,uiGPIOPort,pucGPIOPin);

     console.log(ucPinValue);
     //LIGHT slow
     if(ucPinValue == 1)
     {
         GPIO_IF_LedOn(MCU_RED_LED_GPIO);
     }
     //light high
     else
     {
         GPIO_IF_LedOff(MCU_RED_LED_GPIO);
     }

     //Enable GPIO Interrupt
     MAP_GPIOIntClear(GPIOA0_BASE,GPIO_PIN_7);
     MAP_IntPendClear(INT_GPIOA0);
     MAP_IntEnable(INT_GPIOA0);
     MAP_GPIOIntEnable(GPIOA0_BASE,GPIO_PIN_7);

     ucPinValue=0;
     }

 }


int
main()
{
    //set vector table base 设置中断向量表基址,允许中断,初始化MCU
    BoardInit();

    // Power on the corresponding GPIO port B for 9,10,11.
    // Set up the GPIO lines to mode 0 (GPIO)
    PinMuxConfig();

    GPIO_IF_LedConfigure(LED1|LED2|LED3);

    GPIO_IF_LedOff(MCU_ALL_LED_IND);

    ReadDeviceConfiguration();

    return 0;
}

谢谢老师啦