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);//初始化
zts329547875 发表于 2018-11-22 19:31
key 时钟没有初始化。
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph ...
我初始化了
而且啊,那些例程,我打开后,一进行编译,就有一大堆错误
10ms延时时间,LED基本上没反应吧,好歹也得弄个一两百ms啊。。。
qdhf 发表于 2018-11-22 19:40
我初始化了
F1还是F4,F1的话APB时钟不对,APB2,不是APB1。
F4的话,你看看芯片手册,我没有玩过,不知道
开时钟函数是RCC_AHB1PeriphClockCmd(),你用了RCC_AHB1PeriphResetCmd();其它地方有没看出有错来
不着急慢慢调
按键的几个状态要搞清楚
签到
dacheng12 发表于 2018-11-29 15:00
签到
不好意思发错地方了