标题: STM32单片机读取拨码开关值怎么是fffb [打印本页]

作者: sr861126    时间: 2021-11-25 18:53
标题: STM32单片机读取拨码开关值怎么是fffb
void GPIO_init()
{

GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
        GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable , ENABLE);
        RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB        , ENABLE);
        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8
|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12|GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15;
        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;                // 频率为50MHz
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;

        

        GPIO_Init(GPIOB, &GPIO_InitStructure);
ReadValue = GPIO_ReadInputData(GPIOB);

}

正常没有播下应该是ff00才对






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1