zts329547875 发表于 2018-11-22 19:31:22

key 时钟没有初始化。
GPIO_InitTypeDef GPIO_InitStructure;
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOE, ENABLE); //使能PORTE时钟

    GPIO_InitStructure.GPIO_Pin= (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_InitStructure.GPIO_Mode = GPIO_Mode_IPU; //设置成上拉输入
    GPIO_Init(GPIOE, &GPIO_InitStructure);//初始化

qdhf 发表于 2018-11-22 19:40:52

zts329547875 发表于 2018-11-22 19:31
key 时钟没有初始化。
GPIO_InitTypeDef GPIO_InitStructure;
    RCC_APB2PeriphClockCmd(RCC_APB2Periph ...

我初始化了

qdhf 发表于 2018-11-22 19:46:05

而且啊,那些例程,我打开后,一进行编译,就有一大堆错误

zcl201207 发表于 2018-11-22 21:45:52

10ms延时时间,LED基本上没反应吧,好歹也得弄个一两百ms啊。。。

zts329547875 发表于 2018-11-23 08:39:52

qdhf 发表于 2018-11-22 19:40
我初始化了

F1还是F4,F1的话APB时钟不对,APB2,不是APB1。
F4的话,你看看芯片手册,我没有玩过,不知道

toofree 发表于 2018-11-23 09:34:34

开时钟函数是RCC_AHB1PeriphClockCmd(),你用了RCC_AHB1PeriphResetCmd();其它地方有没看出有错来


tanic 发表于 2018-11-23 12:27:40

不着急慢慢调

钊钊 发表于 2018-11-23 16:56:43

按键的几个状态要搞清楚

dacheng12 发表于 2018-11-29 15:00:17

签到

dacheng12 发表于 2018-11-29 15:04:02

dacheng12 发表于 2018-11-29 15:00
签到

不好意思发错地方了
页: 1 [2] 3
查看完整版本: 求助呀,做一个按键输入实验,怎么都不好使,有图片